home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update32.zoo / lib / diffc < prev    next >
Encoding:
Text File  |  1993-07-14  |  97.8 KB  |  4,067 lines

  1. ===================================================================
  2. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Changelo,v
  3. retrieving revision 1.94
  4. diff -c -r1.94 Changelo
  5. *** 1.94    1993/05/29 20:26:25
  6. --- Changelo    1993/07/13 17:07:21
  7. ***************
  8. *** 3765,3767 ****
  9. --- 3765,3982 ----
  10.       out soft float stuff knows nothing about long doubles.
  11.   
  12.   ---------------------------- Patchlevel 90 ---------------------------
  13. + _addsubs.cpp, _addsubd.cpp, _div*.cpp, _mul*.cpp:: michal
  14. +     following some discussions with Olaf I rewrote addition routines to
  15. +     conform - at least here - strictly to IEEE spec.  As a matter of fact
  16. +     they even decreased in size. :-)
  17. +     this stuff which I am mailing you right now corrects handling
  18. +     various cased when you add or multiply infinities or NaNs.
  19. +     To my best knowledge this now follows IEEE specifications, although
  20. +     do not quote me on that. :-)  There is also some code rearangement
  21. +     in division routines to reduce unnecessary branching.
  22. +     thanks michal!
  23. + osbind.h:: Markus Gutschke <srb242@GOEDEL.UNI-MUENSTER.DE>
  24. +     stack adjustment amount was wrong. was 6 should be 10. thanks
  25. +     markus.
  26. + osbind.h:: Robert.Wilhelm@Physik.TU-Muenchen.DE
  27. +     wrong stack adjustment for trap_1_wwwll was 16 should have
  28. +     been 14. thanks robert.
  29. + ---------------------------- Patchlevel 91 ---------------------------
  30. + pgrp:: 
  31. +     NEWFILE from mintlib 31
  32. +     unistd.h:
  33. +     Added pause() and sigpause() prototypes.  Changed prototype of
  34. +     setpgrp() to reflect new SysV-compatible version, and make proto
  35. +     apply only if not _POSIX_SOURCE.  Changed prototype of getpgrp() to
  36. +     reflect return type of pid_t (POSIX).  Added setpgid(), setsid(),
  37. +     _bsd_setpgrp() and _bsd_getpgrp() protos.  To access the BSD
  38. +     functions by their usual names, define the macro _BSD_PGRP (and do
  39. +     _not_ define _POSIX_SOURCE) before including unistd.h (for example,
  40. +     gcc -D_BSD_PGRP -c foo.c).
  41. +     pgrp.c:
  42. +     NEW file, for process group related functions. Renamed setpgrp to
  43. +     _bsd_setpgrp().  Created new SysV-compatible setpgrp(). Created
  44. +     new BSD-compatible _bsd_getpgrp() (requires MiNT 1.03 or newer).
  45. +     Created new POSIX setpgid() and setsid().
  46. + putpwent.c::
  47. +     NEW file from mntlib 31
  48. + eprintf.c:: mntlib31
  49. +     throw away status buffer. [move buffer onto stk]
  50. + findfile.c:: mntlib31
  51. +     rehacked by Uwe Ohse, 28.4.93, to support reentrant spawn/popen.
  52. + getpw.c:: mntlib31
  53. +     sync up with what appears to be a rewrite
  54. + grp.c:: mntlib31
  55. +     ditto
  56. + linea.h, grp.h, ioctl.h, mintbind.h, osbind.h, ostruct.h pwd.h ::
  57. +     sync with mntlib 31.
  58. + ---------------------------- Patchlevel 92 ---------------------------
  59. + main.c:: andreas
  60. +     the isatty status should be cleared for dumped programs
  61. + float.h:: andreas
  62. +      update for GCC 2.4/enquire 4.3; the values for
  63. +     LDBL_{EPSILON,MIN,MAX} are computed with bc and verified with enquire.
  64. + support.h: ++warwick@cs.uq.oz.au
  65. +     Remove two occurances of the string "new" for C++ compatibility.
  66. + ctype.h: ++entropy
  67. +     More POSIX namespace monkey business.
  68. + types.h: ++entropy
  69. +     Made lots of stuff #ifndef _POSIX_SOURCE.  Added a few POSIX types
  70. +     (nlink_t, mode_t).
  71. + doprnt.c: ++hohmuth
  72. +     Make a long constant explicit for Pure C.
  73. + setjmp.h: ++entropy
  74. +     Implemented BSD-compatible _setjmp(), _longjmp(), setjmp(), and
  75. +     longjmp().  Selectable by defining _BSD_SOURCE.  BUG: not compatible
  76. +     with __STRICT_ANSI__.
  77. + fcntl.h: ++entropy
  78. +     Add POSIX-required mask FD_CLOEXEC, to select the close-on-exec
  79. +     bit from the flags used in F_GETFD/F_SETFD fcntl().
  80. + unistd.h: ++entropy
  81. +     Do not define prototype for getopt() if _POSIX_SOURCE is defined.
  82. + types.h: ++entropy
  83. +     Do not #include <utime.h> if _POSIX_SOURCE is defined.
  84. + utime.h: ++entropy
  85. +     Added prototype for utime().
  86. + unistd.h: ++entropy
  87. +     Changed BSD process group selection switch from _BSD_PGRP to
  88. +     _BSD_SOURCE.
  89. + stat.h: ++nox, ++entropy
  90. +     Added S_ISCHR(), S_ISDIR(), S_ISBLK(), S_ISREG(), S_ISFIFO(),
  91. +     S_ISMEM(), S_ISLNK(), S_IRWXU, S_IRWXG, S_IRWXO.
  92. +     (btw, is S_IMEM a typo of S_IFMEM or was that intentional?)
  93. + setjmp.cpp, setjmp.h: ++entropy
  94. +     Implemented POSIX sigsetjmp() and setlongjmp().
  95. + fopen.c: ++entropy
  96. +     Always use O_NOCTTY flag in the call to open().
  97. + errno.h, strerror.c: ++entropy
  98. +     Add definition of EIO and ENOSPC.
  99. + support.h: ++entropy
  100. +     Prototype for _isctty() from the MiNT libs.
  101. + ctermid.c, stdio.h: ++entropy
  102. +     NEW file, POSIX ctermid() function.  Prototype and constant L_ctermid
  103. +     in stdio.h.
  104. + doprnt.c: ++dsb@cs.duke.edu
  105. +     HSC choked on a string with implicit newlines (that is,
  106. +         "like
  107. +         this"
  108. +     as GCC is wont to do); I replaced it with explicit "\n"'s and string
  109. +     concatenation.
  110. + fread.c, fwrite.c: ++dsb
  111. +     Some judicious changes from size_t to unsigned long to allow reads
  112. +     and writes of >=64K with HSC.
  113. + getpw.c: ++dsb
  114. +     Minor tweak to work around a foible in HSC.
  115. + compiler.h: ++dsb
  116. +     Changes for HSC v2.00 and higher.
  117. + utime.h: ++dsb
  118. +     Changed "#endif _UTIME_H" to "#endif /* _UTIME_H */" to keep HSC
  119. +     from complaining.
  120. + fcntl.h: ++entropy
  121. +     O_NOCTTY definition (for the MiNT libs).
  122. + pgrp.c: ++entropy
  123. +     Made a more reasonable attempt at setsid().  Kludge a way to
  124. +     "disassociate" the controlling tty by forcing fd -1 to /dev/null.
  125. + fwrite.c:: michal
  126. +     With unbuffered IO fwrite miscounts number of characters written.
  127. + a64l.c, calloc.c, chdir.c, chmod.c, eprintf.c, grp.c,lib.h, linea.c,
  128. + psignal.c, putenv.c, raise.c, random.c, regexp.c, regsup.c, strlwr.c,
  129. + strrev.c, strupr.c, strvar.c, textio.c, timeoday.c, *.h:: entropy
  130. +     sync up with mntlib pl 33. most changes are cleanups.
  131. +     (what does linea2 return?)
  132. + --- sync with mntlib34:
  133. + ffs.c: ++frog
  134. +     Much faster algorithm.
  135. + Makefile, _fixsfsi.cpp, _fltsisf.cpp,
  136. + frexp.cpp, modf.cpp : ++dc4i@br0.hrz.th-darmstadt.de (Stefan Steyer)
  137. +     Bug fixes for SFP004 coprocessor code.  Add sfp004 targets.
  138. + doprnt.c: ++schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
  139. +     The decimal precision in a printf format does not include the sign or
  140. +     hex prefix, e.g. printf ("%-2.5d", -18) should print "-00018".
  141. + time.h: ++Frank_Baumgart@pb.maus.de
  142. +     Add prototype of select() to time.h (is there a better place?)
  143. + ctype.h, grp.h, dirent.h, stddef.h, string.h: ++entropy
  144. +     Cleaned up for POSIX.
  145. + wait.h, pwd.h: ++entropy
  146. +     Cleaned up for POSIX (need more work).
  147. + compiler.h, limits.h, stdio.h: ++entropy
  148. +     Set stream limits for POSIX.
  149. + locale.h: ++entropy
  150. +     Define NULL if not already defined (POSIX).
  151. + limits.h: ++entropy
  152. +     Raise value of _POSIX_NGROUPS_MAX from 0 to arbitrary value of
  153. +     512 now that we have a decent getgroups().
  154. + fcntl.h, errno.h: ++entropy
  155. +     Add definition of F_SETLKW to fcntl.h.  Add ELOCKED to errno.h.
  156. +     If Fcntl() gets ELOCKED, return EACCES instead (POSIX).
  157. + unistd.h, stat.h, fcntl.h: ++entropy
  158. +     Moved many prototypes to the correct headers.
  159. + signal.h: ++entropy
  160. +     Fix some violations of POSIX namespace.
  161. + -- end sync
  162. + findfile.c:: michal
  163. +     try to accomodate tos style paths
  164. +     PATH=e:\bin,c:\bin,...
  165. + unistd.h:: ++jrb
  166. +     take out setlinebuf proto, it does'nt really belong here.
  167. + ---------------------------- Patchlevel 93 ---------------------------
  168. ===================================================================
  169. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/Makefile,v
  170. retrieving revision 1.18
  171. diff -c -r1.18 Makefile
  172. *** 1.18    1993/05/21 12:52:49
  173. --- Makefile    1993/07/13 17:07:24
  174. ***************
  175. *** 96,117 ****
  176.   ASFLAGS= -c
  177.   
  178.   # flags to $(CC) when running preprocessor and assembler
  179. ! PPFLAGS= $(SHORT) -P -c
  180.   
  181.   # library targets
  182.   ifdef MINTFLAG
  183.   
  184. ! CLIB= $bmint$g$(ST).olb
  185. ! CLIB020=$bmint$g$(ST)020.olb
  186. ! IIOLIB= $bmiio$g$(ST).olb
  187.   CRT0=$bmcrt0.o
  188.   GCRT0=$bmgcrt0.o
  189.   
  190.   else
  191.   
  192. ! CLIB= $bgnu$g$(ST).olb
  193. ! CLIB020=$bgnu$g$(ST)020.olb
  194. ! IIOLIB= $biio$g$(ST).olb
  195.   CRT0=$bcrt0.o
  196.   GCRT0=$bgcrt0.o
  197.   
  198. --- 96,117 ----
  199.   ASFLAGS= -c
  200.   
  201.   # flags to $(CC) when running preprocessor and assembler
  202. ! PPFLAGS= $(XPFLAGS) $(SHORT) $(SFPFLAG) -P -c
  203.   
  204.   # library targets
  205.   ifdef MINTFLAG
  206.   
  207. ! CLIB= $bmint$g$(SFP)$(ST).olb
  208. ! CLIB020=$bmint$g$(SFP)$(ST)020.olb
  209. ! IIOLIB= $bmiio$g$(SFP)$(ST).olb
  210.   CRT0=$bmcrt0.o
  211.   GCRT0=$bmgcrt0.o
  212.   
  213.   else
  214.   
  215. ! CLIB= $bgnu$g$(SFP)$(ST).olb
  216. ! CLIB020=$bgnu$g$(SFP)$(ST)020.olb
  217. ! IIOLIB= $biio$g$(SFP)$(ST).olb
  218.   CRT0=$bcrt0.o
  219.   GCRT0=$bgcrt0.o
  220.   
  221. ===================================================================
  222. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/PatchLev.h,v
  223. retrieving revision 1.66
  224. diff -c -r1.66 PatchLev.h
  225. *** 1.66    1993/05/29 20:26:29
  226. --- PatchLev.h    1993/07/13 17:07:26
  227. ***************
  228. *** 1,5 ****
  229.   
  230. ! #define    PatchLevel "90"
  231.   
  232.   /*
  233.    *
  234. --- 1,5 ----
  235.   
  236. ! #define    PatchLevel "93"
  237.   
  238.   /*
  239.    *
  240. ===================================================================
  241. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/main.c,v
  242. retrieving revision 1.25
  243. diff -c -r1.25 main.c
  244. *** 1.25    1993/03/16 22:09:03
  245. --- main.c    1993/07/10 16:41:34
  246. ***************
  247. *** 75,81 ****
  248. --- 75,85 ----
  249.       extern int __default_mode__; /* in defmode.c or defined by user */
  250.       int main(int, char **, char **);
  251.   
  252. +     /* clear isatty status for dumped programs */
  253. +     for (i = 0; i < __NHANDLES; i++)
  254. +       __open_stat[i].status = FH_UNKNOWN;
  255.       _start_time = 0;    /* for dumped prgs */
  256.       _start_time = clock();
  257.       _child_runtime = _sys_runtime = 0;
  258.       num_at_exit = 0;
  259. ===================================================================
  260. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/mincl,v
  261. retrieving revision 1.28
  262. diff -c -r1.28 mincl
  263. *** 1.28    1993/05/29 20:26:34
  264. --- mincl    1993/07/10 16:41:35
  265. ***************
  266. *** 38,46 ****
  267.   #
  268.   # other portable stuff
  269.   PORT =  a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
  270. !     getlogin.o getopt.o getpass.o ident.o mktemp.o scandir.o strlwr.o \
  271.       strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
  272. !     il.o ic.o iw.o ig.o ip.o frwbin.o
  273.   #
  274.   # the string library
  275.   
  276. --- 38,46 ----
  277.   #
  278.   # other portable stuff
  279.   PORT =  a64l.o alphasor.o abs.o catch.o dirent.o findfile.o ftw.o getpw.o \
  280. !     getlogin.o getopt.o getpass.o ident.o mktemp.o putpwent.o scandir.o strlwr.o \
  281.       strrev.o strupr.o regexp.o regsup.o textio.o random.o obstack.o \
  282. !     il.o ic.o iw.o ig.o ip.o frwbin.o ctermid.o cuserid.o ffs.o
  283.   #
  284.   # the string library
  285.   
  286. ***************
  287. *** 54,60 ****
  288.   
  289.   UNIX=   access.o chdir.o chmod.o close.o console.o device.o dup.o exec.o fcntl.o \
  290.       fhandle.o fork.o getcwd.o getpid.o getuid.o grp.o ioctl.o isatty.o \
  291. !     link.o lseek.o mkdir.o null.o open.o perror.o pipe.o popen.o psignal.o \
  292.       read.o rename.o rmdir.o \
  293.       sbrk.o sgtty.o signal.o siglist.o sleep.o spawnve.o spawnvp.o stat.o \
  294.       symdir.o symlink.o tchars.o time.o timeoday.o times.o \
  295. --- 54,60 ----
  296.   
  297.   UNIX=   access.o chdir.o chmod.o close.o console.o device.o dup.o exec.o fcntl.o \
  298.       fhandle.o fork.o getcwd.o getpid.o getuid.o grp.o ioctl.o isatty.o \
  299. !     link.o lseek.o mkdir.o null.o open.o perror.o pgrp.o pipe.o popen.o psignal.o \
  300.       read.o rename.o rmdir.o \
  301.       sbrk.o sgtty.o signal.o siglist.o sleep.o spawnve.o spawnvp.o stat.o \
  302.       symdir.o symlink.o tchars.o time.o timeoday.o times.o \
  303. ===================================================================
  304. RCS file: /net/acae127/home/bammi/etc/src/master/atari/lib/signal.c,v
  305. retrieving revision 1.7
  306. diff -c -r1.7 signal.c
  307. *** 1.7    1992/03/28 06:40:31
  308. --- signal.c    1993/07/10 16:41:37
  309. ***************
  310. *** 21,33 ****
  311. --- 21,39 ----
  312.         __Sigfunc s_func;
  313.   };
  314.   /* SIG_DFL == 0, so everything is implicitly set to this */
  315. + /* vector giving which signals are currently blocked from delivery (for TOS) */
  316. + long _sigmask;
  317.   
  318. + /* vector giving an indication of which signals are currently pending (for TOS) */
  319. + long _sigpending;
  320.   static struct sigarray_str    sig_array[NSIG] ;
  321.   
  322.   void
  323.   _init_signal()            /* needed for dumping */
  324.   {
  325.       bzero(sig_array, sizeof(sig_array)); /* for now */
  326. +     _sigpending = _sigmask = 0;
  327.   }
  328.   
  329.   __Sigfunc signal(sig, func)
  330. ===================================================================
  331. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubd.cpp,v
  332. retrieving revision 1.7
  333. diff -c -r1.7 _addsubd.cpp
  334. *** 1.7    1993/05/29 20:28:20
  335. --- _addsubd.cpp    1993/06/04 15:22:06
  336. ***************
  337. *** 11,16 ****
  338. --- 11,20 ----
  339.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  340.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  341.   |
  342. + | Revision 1.3.6 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  343. + |   + ensure that x - x always returns +0, says IEEE,
  344. + |     unless x is Inf or NaN - then return NaN
  345. + |
  346.   | Revision 1.3.5 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  347.   |   + code smoothing
  348.   |
  349. ***************
  350. *** 69,85 ****
  351.       movel    d0,d2        | d2.h = u.sign
  352.       swap    d0
  353.       movew    d0,d2        | d2.l = u.sign
  354. -     bclr    #15,d0        | kill sign bit
  355. -     lsrw    #4,d0
  356.   
  357.       movel    d4,d1        | d1 = v.exp
  358.       andl    d3,d4        | remove exponent from v.mantissa
  359.       swap    d1
  360.       eorw    d1,d2        | d2.l = u.sign ^ v.sign (in bit 15)
  361. !     bclr    #15,d1        | kill sign bit
  362.       lsrw    #4,d1
  363.   |
  364. ! | Now perform testing of NaN And infinities
  365.   |
  366.       movew    #0x7ff,d3
  367.       cmpw    d3,d0
  368. --- 73,98 ----
  369.       movel    d0,d2        | d2.h = u.sign
  370.       swap    d0
  371.       movew    d0,d2        | d2.l = u.sign
  372.   
  373.       movel    d4,d1        | d1 = v.exp
  374.       andl    d3,d4        | remove exponent from v.mantissa
  375.       swap    d1
  376.       eorw    d1,d2        | d2.l = u.sign ^ v.sign (in bit 15)
  377. !     clrb    d2        | we will use the lowest byte as a flag
  378. !     moveq    #15,d3
  379. !     bclr    d3,d0        | kill sign bit u.exp
  380. !     bclr    d3,d1        | kill sign bit v.exp
  381. !     btst    d3,d2        | same sign for u and v?
  382. !     beq    0f
  383. !     cmpl    d0,d1        | different signs - maybe x - x ?
  384. !     bne    0f
  385. !     cmpl    d5,d7
  386. !     seq    d2        | set 'cancellation' flag
  387. ! 0:    lsrw    #4,d0        | keep here exponents only
  388.       lsrw    #4,d1
  389.   |
  390. ! | Now perform testing of NaN and infinities
  391.   |
  392.       movew    #0x7ff,d3
  393.       cmpw    d3,d0
  394. ***************
  395. *** 87,158 ****
  396.       cmpw    d3,d1
  397.       bne    nospec
  398.       bra    1f
  399. - |    first operand is special
  400. - |
  401. - 0:    cmpw    d0,d1
  402. -     beq    bothspec
  403.   |
  404.   |    u is special
  405.   |
  406.       movel    d7,d0
  407.       orl    d6,d0
  408. !     bne    retnan        | arith with Nan gives always Nan
  409. !     movel    a0@(8),d0        | copy infinity
  410. !     moveq    #0,d1
  411. !     bra     return
  412.   |
  413.   |    v is special
  414.   |
  415.   1:    movel    d5,d0
  416.       orl    d4,d0
  417.       bne    retnan
  418. !     movel    a0@,d0
  419.       moveq    #0,d1
  420. !     bra    return
  421. ! |
  422. ! |    u and v are both special
  423. ! |
  424. ! bothspec:
  425. !     movel    d7,d0
  426. !     orl    d6,d0
  427. !     orl    d5,d0
  428. !     orl    d4,d0
  429. !     bne    retnan
  430. ! |
  431. ! | Both are infinities Test if cancellation
  432. ! |
  433. ! bothinf:
  434. !     tstw    d2
  435. !     bpl    retinf
  436.   |
  437.   | return a quiet NaN
  438.   |
  439.   retnan: moveql    #-1,d1
  440.       movel    d1,d0
  441. !     bclr    #31,d0        | 0x7fffffff -> d0
  442.       bra    return
  443. - retinf:    moveq    #0,d1
  444. -     movel    #0xffe00000,d0    | we will return #0xfff00000 or #0x7ff00000
  445. -     lslw    #1,d2
  446. -     roxrl   #1,d0        | shift in high bit as given by d2
  447. - return:    moveml    sp@+,d2-d7
  448. -     rts
  449.   |
  450. ! | Ok, no inifinty or Nan involved..
  451.   |
  452. ! nospec:    bset    #20,d6        | restore implied leading "1"
  453.       tstw    d0        | check for zero exponent - no leading "1"
  454.       bne    1f
  455. !     bclr    #20,d6        | no implied leading "1", instead ...
  456. !     addw    #1,d0        | "normalize" exponent
  457.   1:
  458. !     bset    #20,d4        | restore implied leading "1"
  459.       tstw    d1        | check for zero exponent - no leading "1"
  460.       bne    1f
  461. !     bclr    #20,d4        | no implied leading "1", instead ...
  462. !     addw    #1,d1        | "normalize" exponent
  463.   1:
  464.       moveq    #0,d3        | init sticky register
  465.       negw    d1        | d1 = u.exp - v.exp
  466. --- 100,154 ----
  467.       cmpw    d3,d1
  468.       bne    nospec
  469.       bra    1f
  470.   |
  471.   |    u is special
  472.   |
  473. + 0:    tstb    d2        
  474. +     bne    retnan        | cancellation of specials -> NaN
  475.       movel    d7,d0
  476.       orl    d6,d0
  477. !     bne    retnan        | arith with Nan gives always NaN
  478. !     addqw    #8,a0        | adding to an address propagates anyway
  479. !     cmpw    d3,d1
  480. !     bne    0f        | skip check for NaN if v not special
  481.   |
  482.   |    v is special
  483.   |
  484.   1:    movel    d5,d0
  485.       orl    d4,d0
  486.       bne    retnan
  487. ! 0:    movel    a0@,d0        | copy infinity
  488.       moveq    #0,d1
  489. !     bra     return
  490.   |
  491.   | return a quiet NaN
  492.   |
  493.   retnan: moveql    #-1,d1
  494.       movel    d1,d0
  495. !     lsrl    #1,d0        | 0x7fffffff -> d0
  496.       bra    return
  497.   |
  498. ! | Ok, no inifinty or NaN involved..
  499.   |
  500. ! nospec: tstb    d2
  501. !     beq    0f
  502. !     moveq    #0,d0        | x - x hence we always return +0
  503. !     movel    d0,d1
  504. ! return:    moveml    sp@+,d2-d7
  505. !     rts
  506. ! 0:    moveq    #20,d3
  507. !     bset    d3,d6        | restore implied leading "1"
  508.       tstw    d0        | check for zero exponent - no leading "1"
  509.       bne    1f
  510. !     bclr    d3,d6        | no implied leading "1", instead ...
  511. !     addqw    #1,d0        | "normalize" exponent
  512.   1:
  513. !     bset    d3,d4        | restore implied leading "1"
  514.       tstw    d1        | check for zero exponent - no leading "1"
  515.       bne    1f
  516. !     bclr    d3,d4        | no implied leading "1", instead ...
  517. !     addqw    #1,d1        | "normalize" exponent
  518.   1:
  519.       moveq    #0,d3        | init sticky register
  520.       negw    d1        | d1 = u.exp - v.exp
  521. ***************
  522. *** 174,184 ****
  523.   | most significant digit, while gaining an additional digit for
  524.   | rounding.
  525.   |
  526. !     moveql  #1,d3
  527.   2:    addl    d7,d7
  528.       addxl    d6,d6
  529. !     subw    #1,d0        | decrement exponent
  530. !     subw    #1,d1        | decrement counter
  531.       dbeq    d3,2b
  532.       moveq    #0,d3
  533.   |
  534. --- 170,180 ----
  535.   | most significant digit, while gaining an additional digit for
  536.   | rounding.
  537.   |
  538. !     moveq    #1,d3
  539.   2:    addl    d7,d7
  540.       addxl    d6,d6
  541. !     subqw    #1,d0        | decrement exponent
  542. !     subqw    #1,d1        | decrement counter
  543.       dbeq    d3,2b
  544.       moveq    #0,d3
  545.   |
  546. ***************
  547. *** 192,198 ****
  548.       swap    d5
  549.       clrw    d4
  550.       swap    d4
  551. !     subw    #16,d1
  552.       bra    3b
  553.   
  554.   0:    moveb   d5,d2        | use d2.b as scratch
  555. --- 188,195 ----
  556.       swap    d5
  557.       clrw    d4
  558.       swap    d4
  559. !     subqw    #8,d1
  560. !     subqw    #8,d1
  561.       bra    3b
  562.   
  563.   0:    moveb   d5,d2        | use d2.b as scratch
  564. ***************
  565. *** 206,216 ****
  566.       tstw    d2        | are the signs equal ?
  567.       bpl    6f        | yes, no negate necessary
  568.   |
  569. ! | negate secand mantissa. One has to check the sticky word in order
  570.   | to correct the twos complement.
  571.   |
  572.       tstw    d3        |
  573. !     beq     9f        | No cerrection necessary
  574.       moveq    #0,d1
  575.       addql   #1,d5
  576.       addxl   d1,d4
  577. --- 203,213 ----
  578.       tstw    d2        | are the signs equal ?
  579.       bpl    6f        | yes, no negate necessary
  580.   |
  581. ! | negate second mantissa. One has to check the sticky word in order
  582.   | to correct the twos complement.
  583.   |
  584.       tstw    d3        |
  585. !     beq     9f        | No correction necessary
  586.       moveq    #0,d1
  587.       addql   #1,d5
  588.       addxl   d1,d4
  589. ***************
  590. *** 226,232 ****
  591.   
  592.       negl    d7
  593.       negxl    d6
  594. !     notl    d2        |     switch sign
  595.   7:
  596.       movel    d6,d4        | move result for normalization
  597.       movel    d7,d5
  598. --- 223,229 ----
  599.   
  600.       negl    d7
  601.       negxl    d6
  602. !     notl    d2        | switch sign
  603.   7:
  604.       movel    d6,d4        | move result for normalization
  605.       movel    d7,d5
  606. ===================================================================
  607. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_addsubs.cpp,v
  608. retrieving revision 1.7
  609. diff -c -r1.7 _addsubs.cpp
  610. *** 1.7    1993/05/29 20:28:21
  611. --- _addsubs.cpp    1993/06/04 15:22:08
  612. ***************
  613. *** 12,17 ****
  614. --- 12,19 ----
  615.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  616.   |
  617.   | Revision 1.3.5 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  618. + |   + ensure that x - x always returns +0, says IEEE,
  619. + |     unless x is Inf or NaN - then return NaN
  620.   |   + code smoothing
  621.   |
  622.   | patched by Olaf Flebbe (flebbe@tat.physik.uni-tuebingen.de)
  623. ***************
  624. *** 71,87 ****
  625.       swap    d0
  626.       movew    d0,d2        | d2 = u.sign
  627.       andl    d3,d5        | remove exponent from u.mantissa
  628. -     bclr    #15,d0        | kill sign bit
  629. -     lsrw    #7,d0
  630.   
  631.       movel    d4,d1        | d1 = v.exp
  632.       andl    d3,d4        | remove exponent from v.mantissa
  633.       swap    d1
  634.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  635. !     bclr    #15,d1        | kill sign bit
  636.       lsrw    #7,d1
  637.   |
  638. ! | Now perform testing of NaN And infinities
  639.   |
  640.       moveq    #-1,d3
  641.       cmpb    d3,d0
  642. --- 73,96 ----
  643.       swap    d0
  644.       movew    d0,d2        | d2 = u.sign
  645.       andl    d3,d5        | remove exponent from u.mantissa
  646.   
  647.       movel    d4,d1        | d1 = v.exp
  648.       andl    d3,d4        | remove exponent from v.mantissa
  649.       swap    d1
  650.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  651. !     clrb    d2        | we will use the lowest byte as a flag
  652. !     moveq    #15,d3
  653. !     bclr    d3,d1        | kill sign bit u.exp
  654. !     bclr    d3,d0        | kill sign bit u.exp
  655. !     btst    d3,d2        | same sign for u and v?
  656. !     bne    0f
  657. !     cmpl    d0,d1        | different signs - maybe x - x ?
  658. !     seq    d2        | set 'cancellation' flag
  659. ! 0:
  660. !     lsrw    #7,d0        | keep here exponents only
  661.       lsrw    #7,d1
  662.   |
  663. ! | Now perform testing of NaN and infinities
  664.   |
  665.       moveq    #-1,d3
  666.       cmpb    d3,d0
  667. ***************
  668. *** 89,151 ****
  669.       cmpb    d3,d1
  670.       bne    nospec
  671.       bra    1f
  672. - |    first operand is special
  673.   |
  674. - 0:    cmpb    d0,d1
  675. -     beq    bothspec
  676. - |
  677.   |    u is special
  678.   |
  679.       tstl    d5
  680. !     bne    retnan        | arith with Nan gives always Nan
  681.   
  682. !     movel    a0@(4),d0    | copy infinity with its sign
  683. !     bra     return
  684.   |
  685.   |    v is special
  686.   |
  687.   1:    tstl    d4
  688.       bne    retnan
  689. !     movel    a0@,d0
  690.       bra    return
  691.   |
  692. - |    u and v are both special
  693. - |
  694. - bothspec:
  695. -     movel    d5,d0
  696. -     orl    d4,d0
  697. -     bne    retnan
  698. - |
  699. - | Both are infinities Test if cancellation
  700. - |
  701. - bothinf:
  702. -     tstw    d2
  703. -     bpl    retinf
  704. - |
  705.   | return a quiet NaN
  706.   |
  707.   retnan: moveql    #-1,d0
  708.       lsrl    #1,d0        | 0x7fffffff -> d0
  709.       bra    return
  710. - retinf: movel    #0xff000000,d0  | we will return #0xff800000 or #0x7f800000
  711. -     lslw    #1,d2
  712. -     roxrl   #1,d0        | shift in high bit as given by d2
  713. - return:    moveml    sp@+,d2-d5
  714. -     rts
  715.   |
  716. ! | Ok, no inifinty or Nan involved..
  717.   |
  718. ! nospec:    bset    #23,d5        | restore implied leading "1"
  719.       tstw    d0        | check for zero exponent - no leading "1"
  720.       bne    1f
  721. !     bclr    #23,d5        | remove it
  722.       addqw    #1,d0        | "normalize" exponent
  723.   1:
  724. !     bset    #23,d4        | restore implied leading "1"
  725.       tstw    d1        | check for zero exponent - no leading "1"
  726.       bne    1f
  727. !     bclr    #23,d4        | remove it
  728.       addqw    #1,d1        | "normalize" exponent
  729.   1:
  730.       moveq    #0,d3        | (put initial zero rounding bits in d3)
  731. --- 98,147 ----
  732.       cmpb    d3,d1
  733.       bne    nospec
  734.       bra    1f
  735.   |
  736.   |    u is special
  737.   |
  738. + 0:    tstb    d2        
  739. +     bne    retnan        | cancellation of specials -> NaN
  740.       tstl    d5
  741. !     bne    retnan        | arith with Nan gives always NaN
  742.   
  743. !     addqw    #4,a0        | here is an infinity
  744. !     cmpb    d3,d1
  745. !     bne    0f        | skip check for NaN if v not special
  746.   |
  747.   |    v is special
  748.   |
  749.   1:    tstl    d4
  750.       bne    retnan
  751. ! 0:    movel    a0@,d0
  752.       bra    return
  753.   |
  754.   | return a quiet NaN
  755.   |
  756.   retnan: moveql    #-1,d0
  757.       lsrl    #1,d0        | 0x7fffffff -> d0
  758.       bra    return
  759.   |
  760. ! | Ok, no inifinty or NaN involved..
  761.   |
  762. ! nospec:    tstb    d2
  763. !     beq    0f
  764. !     moveq    #0,d0        | x - x hence we always return +0
  765. ! return:    moveml    sp@+,d2-d5
  766. !     rts
  767. ! 0:    moveq    #23,d3
  768. !     bset    d3,d5        | restore implied leading "1"
  769.       tstw    d0        | check for zero exponent - no leading "1"
  770.       bne    1f
  771. !     bclr    d3,d5        | remove it
  772.       addqw    #1,d0        | "normalize" exponent
  773.   1:
  774. !     bset    d3,d4        | restore implied leading "1"
  775.       tstw    d1        | check for zero exponent - no leading "1"
  776.       bne    1f
  777. !     bclr    d3,d4        | remove it
  778.       addqw    #1,d1        | "normalize" exponent
  779.   1:
  780.       moveq    #0,d3        | (put initial zero rounding bits in d3)
  781. ***************
  782. *** 179,185 ****
  783.       orw    d4,d3        | set rounding bits
  784.       clrw    d4
  785.       swap    d4
  786. !     subw    #16,d1
  787.           bra     4f
  788.   
  789.   0:    moveb   d4,d2
  790. --- 175,182 ----
  791.       orw    d4,d3        | set rounding bits
  792.       clrw    d4
  793.       swap    d4
  794. !     subqw    #8,d1
  795. !     subqw    #8,d1
  796.           bra     4f
  797.   
  798.   0:    moveb   d4,d2
  799. ===================================================================
  800. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divdf3.cpp,v
  801. retrieving revision 1.7
  802. diff -c -r1.7 _divdf3.cpp
  803. *** 1.7    1993/05/29 20:28:23
  804. --- _divdf3.cpp    1993/06/04 15:22:10
  805. ***************
  806. *** 82,95 ****
  807.       andl    d3,d4        | remove exponent from u.mantissa
  808.       swap    d0
  809.       movew    d0,d2        | d2 = u.sign
  810. -     bclr    #15,d0        | kill sign bit
  811. -     lsrw    #4,d0
  812.   
  813.       movel    d6,d1        | d1 = v.exp
  814.       andl    d3,d6        | remove exponent from v.mantissa
  815.       swap    d1
  816.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  817. !     bclr    #15,d1        | kill sign bit
  818.       lsrw    #4,d1
  819.   |
  820.   |
  821. --- 82,97 ----
  822.       andl    d3,d4        | remove exponent from u.mantissa
  823.       swap    d0
  824.       movew    d0,d2        | d2 = u.sign
  825.   
  826.       movel    d6,d1        | d1 = v.exp
  827.       andl    d3,d6        | remove exponent from v.mantissa
  828.       swap    d1
  829.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  830. !     moveq    #15,d3
  831. !     bclr    d3,d1        | kill sign bit
  832. !     bclr    d3,d0        | kill sign bit
  833. !     lsrw    #4,d0
  834.       lsrw    #4,d1
  835.   |
  836.   |
  837. ***************
  838. *** 111,170 ****
  839.       movel    d7,d3
  840.       orl    d6,d3
  841.       bne    nospec
  842. !     bra    retinf        | x/0 -> +/- Inf
  843.   
  844.   0:    orl    d5,d4        | u == NaN ?
  845.       bne    retnan        | NaN/ x
  846. !     cmpw    #0x7ff,d1
  847.       beq    retnan        | Inf/Inf or Inf/NaN
  848.       bra    retinf        | Inf/x | x != Inf && x != NaN
  849.   
  850.   1:    orl    d7,d6
  851.       bne    retnan        | x/NaN
  852. !     bra    retzero        | x/Inf -> +/- 0
  853.   
  854.   2:    tstw    d1
  855.       bne    retzero        | 0/x ->+/- 0
  856.       orl    d5,d4
  857.       bne    retzero        | 0/x
  858. !     bra    retnan        | 0/0
  859. ! |
  860. ! |    Return Infinity with correct sign
  861. ! |
  862. ! retinf:    moveq    #0,d1
  863. !     movel    #0xffe00000,d0
  864. !     lslw    #1,d2
  865. !     roxrl   #1,d0        | shift in high bit as given by d2
  866. ! return:    moveml    sp@+,d2-d7
  867. !     rts
  868.   |
  869.   |    Return NaN
  870.   |
  871.   retnan: moveql    #-1,d1
  872.       movel    d1,d0
  873. !     bclr    #31,d0        | 0x7fffffff -> d0
  874. !     bra    return
  875. ! |
  876. ! |    Return correct signed zero
  877. ! |
  878. ! retzero:moveq    #0,d0        | zero destination
  879. !     movel    d0,d1
  880. !     lslw    #1,d2        | we need an extension bit
  881. !     roxrl    #1,d0
  882.       bra    return
  883.   |
  884.   |    End of special handling
  885.   |
  886. ! nospec:    bset    #20,d4        | restore implied leading "1"
  887.       tstw    d0        | check for zero exponent - no leading "1"
  888.       bne    1f
  889. !     bclr    #20,d4        | remove it
  890.       addw    #1,d0        | "normalize" exponent
  891.   
  892. ! 1:    bset    #20,d6        | restore implied leading "1"
  893.       tstw    d1        | check for zero exponent - no leading "1"
  894.       bne    1f
  895. !     bclr    #20,d6        | remove it
  896.   0:    addw    #1,d1        | "normalize" exponent
  897.   
  898.   1:    movew    d2,a0        | save sign
  899. --- 113,173 ----
  900.       movel    d7,d3
  901.       orl    d6,d3
  902.       bne    nospec
  903. ! |    bra    retinf        | x/0 -> +/- Inf
  904. ! |
  905. ! |    Return Infinity with correct sign
  906. ! |
  907. ! retinf:    moveq    #0,d1
  908. !     movel    #0xffe00000,d0
  909. !     lslw    #1,d2
  910. !     roxrl   #1,d0        | shift in high bit as given by d2
  911. ! return:    moveml    sp@+,d2-d7
  912. !     rts
  913.   
  914.   0:    orl    d5,d4        | u == NaN ?
  915.       bne    retnan        | NaN/ x
  916. !     cmpw    d3,d1
  917.       beq    retnan        | Inf/Inf or Inf/NaN
  918.       bra    retinf        | Inf/x | x != Inf && x != NaN
  919.   
  920.   1:    orl    d7,d6
  921.       bne    retnan        | x/NaN
  922. ! |    bra    retzero        | x/Inf -> +/- 0
  923. ! |
  924. ! |    Return correct signed zero
  925. ! |
  926. ! retzero:moveq    #0,d0        | zero destination
  927. !     movel    d0,d1
  928. !     lslw    #1,d2        | we need an extension bit
  929. !     roxrl    #1,d0
  930. !     bra    return
  931.   
  932.   2:    tstw    d1
  933.       bne    retzero        | 0/x ->+/- 0
  934.       orl    d5,d4
  935.       bne    retzero        | 0/x
  936. ! |    bra    retnan        | 0/0
  937.   |
  938.   |    Return NaN
  939.   |
  940.   retnan: moveql    #-1,d1
  941.       movel    d1,d0
  942. !     lsrl    #1,d0        | 0x7fffffff -> d0
  943.       bra    return
  944.   |
  945.   |    End of special handling
  946.   |
  947. ! nospec:    moveq    #20,d3
  948. !     bset    d3,d4        | restore implied leading "1"
  949.       tstw    d0        | check for zero exponent - no leading "1"
  950.       bne    1f
  951. !     bclr    d3,d4        | remove it
  952.       addw    #1,d0        | "normalize" exponent
  953.   
  954. ! 1:    bset    d3,d6        | restore implied leading "1"
  955.       tstw    d1        | check for zero exponent - no leading "1"
  956.       bne    1f
  957. !     bclr    d3,d6        | remove it
  958.   0:    addw    #1,d1        | "normalize" exponent
  959.   
  960.   1:    movew    d2,a0        | save sign
  961. ===================================================================
  962. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_divsf3.cpp,v
  963. retrieving revision 1.7
  964. diff -c -r1.7 _divsf3.cpp
  965. *** 1.7    1993/05/29 20:28:26
  966. --- _divsf3.cpp    1993/06/04 15:22:12
  967. ***************
  968. *** 82,102 ****
  969.       andl    d3,d4        | remove exponent from u.mantissa
  970.       swap    d0
  971.       movew    d0,d2        | d2 = u.sign
  972. -     bclr    #15,d0        | kill sign bit
  973. -     lsrw    #7,d0
  974.   
  975.       movel    d5,d1        | d1 = v.exp
  976.       andl    d3,d5        | remove exponent from v.mantissa
  977.       swap    d1
  978.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  979. !     bclr    #15,d1        | kill sign bit
  980.       lsrw    #7,d1
  981.   |
  982.   |
  983.   |
  984.       moveq    #-1,d3
  985.       cmpb    d3,d0        | comparison with #0xff
  986. !     beq    0f        |u == NaN || u== Inf
  987.       cmpb    d3,d1
  988.       beq    1f        | v == NaN || v == Inf
  989.       tstb    d0
  990. --- 82,104 ----
  991.       andl    d3,d4        | remove exponent from u.mantissa
  992.       swap    d0
  993.       movew    d0,d2        | d2 = u.sign
  994.   
  995.       movel    d5,d1        | d1 = v.exp
  996.       andl    d3,d5        | remove exponent from v.mantissa
  997.       swap    d1
  998.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  999. !     moveq    #15,d3
  1000. !     bclr    d3,d0        | kill sign bit
  1001. !     bclr    d3,d1        | kill sign bit
  1002. !     lsrw    #7,d0
  1003.       lsrw    #7,d1
  1004.   |
  1005.   |
  1006.   |
  1007.       moveq    #-1,d3
  1008.       cmpb    d3,d0        | comparison with #0xff
  1009. !     beq    0f        | u == NaN || u== Inf
  1010.       cmpb    d3,d1
  1011.       beq    1f        | v == NaN || v == Inf
  1012.       tstb    d0
  1013. ***************
  1014. *** 115,131 ****
  1015.       bne    retnan        | NaN/ x
  1016.       cmpb    d3,d1
  1017.       beq    retnan        | Inf/Inf or Inf/NaN
  1018. !     bra    retinf        | Inf/x | x != Inf && x != NaN
  1019. ! 1:    tstl    d5
  1020. !     bne    retnan        | x/NaN
  1021. !     bra    retzero        | x/Inf -> +/- 0
  1022. ! 2:    tstw    d1
  1023. !     bne    retzero        | 0/x ->+/- 0
  1024. !     tstl    d4
  1025. !     bne    retzero        | 0/x
  1026. !     bra    retnan        | 0/0
  1027.   |
  1028.   |    Return Infinity with correct sign
  1029.   |
  1030. --- 117,123 ----
  1031.       bne    retnan        | NaN/ x
  1032.       cmpb    d3,d1
  1033.       beq    retnan        | Inf/Inf or Inf/NaN
  1034. ! |    bra    retinf        | Inf/x | x != Inf && x != NaN
  1035.   |
  1036.   |    Return Infinity with correct sign
  1037.   |
  1038. ***************
  1039. *** 134,145 ****
  1040.       roxrl   #1,d0        | shift in high bit as given by d2
  1041.   return:    moveml    sp@+,d2-d5
  1042.       rts
  1043. ! |
  1044. ! |    Return NaN
  1045. ! |
  1046. ! retnan: movel    d3,d0        | d3 contains 0xffffffff
  1047. !     bclr    #31,d0
  1048. !     bra    return
  1049.   |
  1050.   |    Return correct signed zero
  1051.   |
  1052. --- 126,135 ----
  1053.       roxrl   #1,d0        | shift in high bit as given by d2
  1054.   return:    moveml    sp@+,d2-d5
  1055.       rts
  1056. ! 1:    tstl    d5
  1057. !     bne    retnan        | x/NaN
  1058. ! |    bra    retzero        | x/Inf -> +/- 0
  1059.   |
  1060.   |    Return correct signed zero
  1061.   |
  1062. ***************
  1063. *** 147,168 ****
  1064.       lslw    #1,d2        | set X bit accordingly
  1065.       roxrl    #1,d0
  1066.       bra    return
  1067.   |
  1068.   |    End of special handling
  1069.   |
  1070. ! nospec:    bset    #23,d4        | restore implied leading "1"
  1071.       tstw    d0        | check for zero exponent - no leading "1"
  1072.       bne    1f
  1073. !     bclr    #23,d4        | remove it
  1074.       addw    #1,d0        | "normalize" exponent
  1075.   1:
  1076.       tstl    d4
  1077.       beq    retzero        | dividing zero
  1078.   
  1079. !     bset    #23,d5        | restore implied leading "1"
  1080.       tstw    d1        | check for zero exponent - no leading "1"
  1081.       bne    1f
  1082. !     bclr    #23,d5        | remove it
  1083.       addw    #1,d1        | "normalize" exponent
  1084.   1:
  1085.   # ifndef ERROR_CHECK
  1086. --- 137,171 ----
  1087.       lslw    #1,d2        | set X bit accordingly
  1088.       roxrl    #1,d0
  1089.       bra    return
  1090. + 2:    tstw    d1
  1091. +     bne    retzero        | 0/x ->+/- 0
  1092. +     tstl    d4
  1093. +     bne    retzero        | 0/x
  1094. + |    bra    retnan        | 0/0
  1095. + |
  1096. + |    Return NaN
  1097. + |
  1098. + retnan: movel    d3,d0        | d3 contains 0xffffffff
  1099. +     lsrl    #1,d0
  1100. +     bra    return
  1101.   |
  1102.   |    End of special handling
  1103.   |
  1104. ! nospec:    moveq    #23,d3
  1105. !     bset    d3,d4        | restore implied leading "1"
  1106.       tstw    d0        | check for zero exponent - no leading "1"
  1107.       bne    1f
  1108. !     bclr    d3,d4        | remove it
  1109.       addw    #1,d0        | "normalize" exponent
  1110.   1:
  1111.       tstl    d4
  1112.       beq    retzero        | dividing zero
  1113.   
  1114. !     bset    d3,d5        | restore implied leading "1"
  1115.       tstw    d1        | check for zero exponent - no leading "1"
  1116.       bne    1f
  1117. !     bclr    d3,d5        | remove it
  1118.       addw    #1,d1        | "normalize" exponent
  1119.   1:
  1120.   # ifndef ERROR_CHECK
  1121. ***************
  1122. *** 171,181 ****
  1123.   # endif    ERROR_CHECK
  1124.   
  1125.       subw    d1,d0        | subtract exponents,
  1126. !     addw    #BIAS4-8+1,d0    |  add bias back in, account for shift
  1127. !     addw    #34,d0        |  add loop offset, +2 for extra rounding bits
  1128. !                 |   for denormalized numbers (2 implied by dbra)
  1129.       movew    #27,d1        | bit number for "implied" pos (+4 for rounding)
  1130. !     moveql    #-1,d3        |  zero quotient (for speed a one''s complement)
  1131.       subl    d5,d4        | initial subtraction, u = u - v
  1132.   2:
  1133.       btst    d1,d3        | divide until 1 in implied position
  1134. --- 174,184 ----
  1135.   # endif    ERROR_CHECK
  1136.   
  1137.       subw    d1,d0        | subtract exponents,
  1138. !     addw    #BIAS4-8+1,d0    | add bias back in, account for shift
  1139. !     addw    #34,d0        | add loop offset, +2 for extra rounding bits
  1140. !                 | for denormalized numbers (2 implied by dbra)
  1141.       movew    #27,d1        | bit number for "implied" pos (+4 for rounding)
  1142. !     moveql    #-1,d3        | zero quotient (for speed a one''s complement)
  1143.       subl    d5,d4        | initial subtraction, u = u - v
  1144.   2:
  1145.       btst    d1,d3        | divide until 1 in implied position
  1146. ===================================================================
  1147. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_fixsfsi.cpp,v
  1148. retrieving revision 1.4
  1149. diff -c -r1.4 _fixsfsi.cpp
  1150. *** 1.4    1993/05/29 20:28:30
  1151. --- _fixsfsi.cpp    1993/07/13 17:03:36
  1152. ***************
  1153. *** 28,33 ****
  1154. --- 28,34 ----
  1155.   1:    cmpiw    #0x8900,a0@(resp)
  1156.       beq    1b
  1157.       movel    a0@,d0
  1158. +     rts
  1159.   
  1160.   #else /* !sfp004 */
  1161.   
  1162. ===================================================================
  1163. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_fltsisf.cpp,v
  1164. retrieving revision 1.3
  1165. diff -c -r1.3 _fltsisf.cpp
  1166. *** 1.3    1993/05/29 20:28:32
  1167. --- _fltsisf.cpp    1993/07/13 17:03:38
  1168. ***************
  1169. *** 23,29 ****
  1170.       movew    #0x4000,a0@(comm)    | load long int to fp0
  1171.       cmpiw    #0x8900,a0@(resp)    | check
  1172.       movel    a7@(4),a0@
  1173. !     movew    #0x7400,a0@(comm)    | get double from fp0
  1174.   | wait loop is NOT coded directly
  1175.   1:    cmpw    #0x8900,a0@(resp)
  1176.       beq    1b
  1177. --- 23,29 ----
  1178.       movew    #0x4000,a0@(comm)    | load long int to fp0
  1179.       cmpiw    #0x8900,a0@(resp)    | check
  1180.       movel    a7@(4),a0@
  1181. !     movew    #0x6400,a0@(comm)    | get single from fp0
  1182.   | wait loop is NOT coded directly
  1183.   1:    cmpw    #0x8900,a0@(resp)
  1184.       beq    1b
  1185. ===================================================================
  1186. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_muldf3.cpp,v
  1187. retrieving revision 1.5
  1188. diff -c -r1.5 _muldf3.cpp
  1189. *** 1.5    1993/05/29 20:28:35
  1190. --- _muldf3.cpp    1993/06/04 15:22:14
  1191. ***************
  1192. *** 58,63 ****
  1193. --- 58,66 ----
  1194.   |
  1195.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1196.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1197. + | Revision 1.2.4 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  1198. + |   + ensure that Inf * NaN == NaN * Inf == NaN
  1199. + |     and 0 * Inf = Inf * 0 = NaN
  1200.   |
  1201.   | Revision 1.2.3 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  1202.   |   + code smoothing
  1203. ***************
  1204. *** 91,104 ****
  1205.       andl    d3,d6        | remove exponent from u.mantissa
  1206.       swap    d0
  1207.       movew    d0,d2        | d2 = u.sign
  1208. -     bclr    #15,d0        | kill sign bit
  1209. -     lsrw    #4,d0
  1210.   
  1211.       movel    d4,d1        | d1 = v.exp
  1212.       andl    d3,d4        | remove exponent from v.mantissa
  1213.       swap    d1
  1214.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  1215. !     bclr    #15,d1        | kill sign bit
  1216.       lsrw    #4,d1
  1217.   |
  1218.   | Testing for NaN and Infinities
  1219. --- 94,117 ----
  1220.       andl    d3,d6        | remove exponent from u.mantissa
  1221.       swap    d0
  1222.       movew    d0,d2        | d2 = u.sign
  1223.   
  1224.       movel    d4,d1        | d1 = v.exp
  1225.       andl    d3,d4        | remove exponent from v.mantissa
  1226.       swap    d1
  1227.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  1228. !     
  1229. !     moveq    #15,d3
  1230. !     bclr    d3,d0        | kill sign bit
  1231. !     bclr    d3,d1        | kill sign bit
  1232. !     tstl    d0        | test if one of factors is 0
  1233. !     bne    0f        | if not the first one then maybe the second
  1234. !     tstl    d7
  1235. !     beq    1f
  1236. ! 0:    tstl    d1
  1237. !     bne    1f
  1238. !     tstl    d5
  1239. ! 1:    seq    d2        | 'one of factors is 0' flag in the lowest byte
  1240. !     lsrw    #4,d0        | keep in d0, d1 exponents only
  1241.       lsrw    #4,d1
  1242.   |
  1243.   | Testing for NaN and Infinities
  1244. ***************
  1245. *** 113,123 ****
  1246.   |    Nan?
  1247.   0:    orl    d7,d6
  1248.       bne    retnan
  1249. ! |    Test v==0.
  1250. !     tstw    d1
  1251. !     bne    retinf  |  Inf  * x == Inf
  1252. !     orl    d5,d4
  1253. !     beq    retnan  | Inf * 0 == NaN
  1254.   |
  1255.   |    Return Infinity with correct sign
  1256.   |
  1257. --- 126,135 ----
  1258.   |    Nan?
  1259.   0:    orl    d7,d6
  1260.       bne    retnan
  1261. ! 1:    tstb    d2        | 0 times special or special times 0 ?
  1262. !     bne    retnan        | yes -> NaN
  1263. !     cmpw    d3,d1        | is the other special?
  1264. !     beq    2f        | maybe it is NaN
  1265.   |
  1266.   |    Return Infinity with correct sign
  1267.   |
  1268. ***************
  1269. *** 128,168 ****
  1270.   return:    moveml    sp@+,d2-d7
  1271.       rts
  1272.   |
  1273.   |    Return NaN
  1274.   |
  1275.   retnan: moveql    #-1,d1
  1276.       movel    d1,d0
  1277. !     bclr    #31,d0        | 0x7fffffff -> d0
  1278.       bra    return
  1279.   |
  1280. - | v is special
  1281. - |
  1282. - 1:    orl    d5,d4
  1283. -     bne    retnan
  1284. -     tstw    d0
  1285. -     bne    retinf
  1286. -     orl    d7,d6
  1287. -     beq    retnan
  1288. -     bra    retinf
  1289. - |
  1290.   | end of NaN and Inf.
  1291.   |
  1292. ! nospec:    subw    #16,sp        | multiplication accumulator
  1293.   
  1294. !     bset    #20,d6        | restore implied leading "1"
  1295.       tstw    d0        | check for zero exponent - no leading "1"
  1296.       bne    1f
  1297. !     bclr    #20,d6        | remove it
  1298. !     addw    #1,d0        | "normalize" exponent
  1299.   1:    movel    d6,d3
  1300.       orl    d7,d3
  1301.       beq    retz        | multiplying by zero
  1302.   
  1303. !     bset    #20,d4        | restore implied leading "1"
  1304.       tstw    d1        | check for zero exponent - no leading "1"
  1305.       bne    1f
  1306. !     bclr    #20,d4        | remove it
  1307. !     addw    #1,d1        | "normalize" exponent
  1308.   1:    movel    d4,d3
  1309.       orl    d5,d3
  1310.       beq    retz        | multiplying by zero
  1311. --- 140,179 ----
  1312.   return:    moveml    sp@+,d2-d7
  1313.       rts
  1314.   |
  1315. + | v is special
  1316. + |
  1317. + 2:    orl    d5,d4        | is v NaN?
  1318. +     beq    retinf        | if not then we have (not-NaN * Inf)
  1319. + |
  1320.   |    Return NaN
  1321.   |
  1322.   retnan: moveql    #-1,d1
  1323.       movel    d1,d0
  1324. !     lsrl    #1,d0        | 0x7fffffff -> d0
  1325.       bra    return
  1326.   |
  1327.   | end of NaN and Inf.
  1328.   |
  1329. ! nospec:    tstb    d2        | not needed - but we can waste two instr.
  1330. !     bne    retzz        | return signed 0 if one of factors is 0
  1331. !     lea    sp@(-16),sp    | multiplication accumulator
  1332.   
  1333. !     moveq    #20,d3
  1334. !     bset    d3,d6        | restore implied leading "1"
  1335.       tstw    d0        | check for zero exponent - no leading "1"
  1336.       bne    1f
  1337. !     bclr    d3,d6        | remove it
  1338. !     addqw    #1,d0        | "normalize" exponent
  1339.   1:    movel    d6,d3
  1340.       orl    d7,d3
  1341.       beq    retz        | multiplying by zero
  1342.   
  1343. !     moveq    #20,d3
  1344. !     bset    d3,d4        | restore implied leading "1"
  1345.       tstw    d1        | check for zero exponent - no leading "1"
  1346.       bne    1f
  1347. !     bclr    d3,d4        | remove it
  1348. !     addqw    #1,d1        | "normalize" exponent
  1349.   1:    movel    d4,d3
  1350.       orl    d5,d3
  1351.       beq    retz        | multiplying by zero
  1352. ***************
  1353. *** 227,233 ****
  1354.       movew    d6,d5
  1355.       movew    d7,d6
  1356.       clrw    d7
  1357. !     subw    #16,d0        | decrement exponent
  1358.       bra    2b
  1359.   3:
  1360.       movel    d6,d1        | get rounding bits
  1361. --- 238,245 ----
  1362.       movew    d6,d5
  1363.       movew    d7,d6
  1364.       clrw    d7
  1365. !     subqw    #8,d0        | decrement exponent
  1366. !     subqw    #8,d0
  1367.       bra    2b
  1368.   3:
  1369.       movel    d6,d1        | get rounding bits
  1370. ***************
  1371. *** 237,250 ****
  1372.       andl    #0xffffff00,d3
  1373.       beq    4f
  1374.       orb    #1,d1        | set "sticky bit" if any low-order set
  1375. ! 4:    addw    #16,sp        | remove accumulator from stack
  1376.       jmp    norm_df        | (result in d4/d5)
  1377.   |                | norm_df does not return here
  1378. ! retz:    moveq    #0,d0        | save zero as result
  1379.       movel    d0,d1
  1380.       lslw    #1,d2        | fill X bit
  1381.       roxrl    #1,d0        | set high bit of d0 accordingly
  1382. -     addw    #16,sp
  1383.       moveml    sp@+,d2-d7
  1384.       rts            | no normalizing neccessary
  1385.   
  1386. --- 249,262 ----
  1387.       andl    #0xffffff00,d3
  1388.       beq    4f
  1389.       orb    #1,d1        | set "sticky bit" if any low-order set
  1390. ! 4:    lea    sp@(16),sp    | remove accumulator from stack
  1391.       jmp    norm_df        | (result in d4/d5)
  1392.   |                | norm_df does not return here
  1393. ! retz:    lea    sp@(16),sp    | drop accumulator space
  1394. ! retzz:    moveq    #0,d0        | save zero as result
  1395.       movel    d0,d1
  1396.       lslw    #1,d2        | fill X bit
  1397.       roxrl    #1,d0        | set high bit of d0 accordingly
  1398.       moveml    sp@+,d2-d7
  1399.       rts            | no normalizing neccessary
  1400.   
  1401. ===================================================================
  1402. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/_mulsf3.cpp,v
  1403. retrieving revision 1.5
  1404. diff -c -r1.5 _mulsf3.cpp
  1405. *** 1.5    1993/05/29 20:28:36
  1406. --- _mulsf3.cpp    1993/06/04 15:22:16
  1407. ***************
  1408. *** 46,51 ****
  1409. --- 46,55 ----
  1410.   | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  1411.   | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  1412.   |
  1413. + | Revision 1.2.4 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  1414. + |   + ensure that Inf * NaN == NaN * Inf == NaN
  1415. + |     and 0 * Inf = Inf * 0 = NaN
  1416. + |
  1417.   | Revision 1.2.3 michal 05-93 (ntomczak@vm.ucs.ualberta.ca)
  1418.   |   + code smoothing
  1419.   |
  1420. ***************
  1421. *** 79,92 ****
  1422.       andl    d3,d5        | remove exponent from u.mantissa
  1423.       swap    d0
  1424.       movew    d0,d2        | d2 = u.sign
  1425. -     bclr    #15,d0        | kill sign bit
  1426. -     lsrw    #7,d0
  1427.   
  1428.       movel    d4,d1        | d1 = v.exp
  1429.       andl    d3,d4        | remove exponent from v.mantissa
  1430.       swap    d1
  1431.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  1432. !     bclr    #15,d1        | kill sign bit
  1433.       lsrw    #7,d1
  1434.   
  1435.   |
  1436. --- 83,102 ----
  1437.       andl    d3,d5        | remove exponent from u.mantissa
  1438.       swap    d0
  1439.       movew    d0,d2        | d2 = u.sign
  1440.   
  1441.       movel    d4,d1        | d1 = v.exp
  1442.       andl    d3,d4        | remove exponent from v.mantissa
  1443.       swap    d1
  1444.       eorw    d1,d2        | d2 = u.sign ^ v.sign (in bit 15)
  1445. !     
  1446. !     moveq    #15,d3
  1447. !     bclr    d3,d0        | kill sign bit
  1448. !     bclr    d3,d1        | kill sign bit
  1449. !     tstl    d0        | test if one of factors is 0
  1450. !     beq    1f
  1451. !     tstl    d1
  1452. ! 1:    seq    d2        | 'one of factors is 0' flag in the lowest byte
  1453. !     lsrw    #7,d0        | keep here exponents only
  1454.       lsrw    #7,d1
  1455.   
  1456.   |
  1457. ***************
  1458. *** 98,113 ****
  1459.       cmpb    d3,d1
  1460.       bne    nospec
  1461.       bra    1f
  1462.   |    first operand is special
  1463. ! |    Nan?
  1464. ! 0:    tstl    d5
  1465.       bne    retnan
  1466. ! |    Test v==0.
  1467. !     tstb    d1
  1468. !     bne    retinf  |  Inf  * x == Inf
  1469. !     tstl    d4
  1470. !     beq    retnan  | Inf * 0 == NaN
  1471.   |
  1472.   |    Return Infinity with correct sign
  1473.   |
  1474. --- 108,122 ----
  1475.       cmpb    d3,d1
  1476.       bne    nospec
  1477.       bra    1f
  1478. + |
  1479.   |    first operand is special
  1480. ! |
  1481. ! 0:    tstl    d5        | is it NaN?
  1482.       bne    retnan
  1483. ! 1:    tstb    d2        | 0 times special or special times 0 ?
  1484. !     bne    retnan        | yes -> NaN
  1485. !     cmpb    d3,d1        | is the other special ?
  1486. !     beq    2f        | maybe it is NaN
  1487.   |
  1488.   |    Return Infinity with correct sign
  1489.   |
  1490. ***************
  1491. *** 116,153 ****
  1492.       roxrl   #1,d0        | shift in high bit as given by d2
  1493.   return:    moveml    sp@+,d2-d5
  1494.       rts
  1495.   |
  1496. ! |    Return NaN
  1497.   |
  1498.   retnan: moveql    #-1,d0
  1499.       lsrl    #1,d0        | 0x7fffffff -> d0
  1500.       bra    return
  1501.   |
  1502. - | v is special
  1503. - |
  1504. - 1:    tstl    d4
  1505. -     bne    retnan
  1506. -     tstb    d0
  1507. -     bne    retinf
  1508. -     tstl    d5
  1509. -     beq    retnan
  1510. -     bra    retinf
  1511. - |
  1512.   | end of NaN and Inf.
  1513.   |
  1514. ! nospec:    bset    #23,d5        | restore implied leading "1"
  1515. !     subw    #8,sp        | multiplication accumulator
  1516.       tstw    d0        | check for zero exponent - no leading "1"
  1517.       bne    1f
  1518. !     bclr    #23,d5        | remove it
  1519.       addqw    #1,d0        | "normalize" exponent
  1520.   1:    tstl    d5
  1521.       beq    retz        | multiplying zero
  1522.   
  1523. !     bset    #23,d4        | restore implied leading "1"
  1524.       tstw    d1        | check for zero exponent - no leading "1"
  1525.       bne    1f
  1526. !     bclr    #23,d4        | remove it
  1527.       addqw    #1,d1        | "normalize" exponent
  1528.   1:    tstl    d4
  1529.       beq    retz        | multiply by zero
  1530. --- 125,160 ----
  1531.       roxrl   #1,d0        | shift in high bit as given by d2
  1532.   return:    moveml    sp@+,d2-d5
  1533.       rts
  1534.   |
  1535. ! | v is special
  1536.   |
  1537. +     
  1538. + 2:    tstl    d4        | is this NaN?
  1539. +     beq    retinf        | we know that the other is not zero
  1540.   retnan: moveql    #-1,d0
  1541.       lsrl    #1,d0        | 0x7fffffff -> d0
  1542.       bra    return
  1543.   |
  1544.   | end of NaN and Inf.
  1545.   |
  1546. ! nospec:    tstb    d2        | not needed - but we can waste two instr.
  1547. !     bne    retzz        | return signed 0 if one of factors is 0
  1548. !     moveq    #23,d3
  1549. !     bset    d3,d5        | restore implied leading "1"
  1550. !     subqw    #8,sp        | multiplication accumulator
  1551.       tstw    d0        | check for zero exponent - no leading "1"
  1552.       bne    1f
  1553. !     bclr    d3,d5        | remove it
  1554.       addqw    #1,d0        | "normalize" exponent
  1555.   1:    tstl    d5
  1556.       beq    retz        | multiplying zero
  1557.   
  1558. !     moveq    #23,d3
  1559. !     bset    d3,d4        | restore implied leading "1"
  1560.       tstw    d1        | check for zero exponent - no leading "1"
  1561.       bne    1f
  1562. !     bclr    d3,d4        | remove it
  1563.       addqw    #1,d1        | "normalize" exponent
  1564.   1:    tstl    d4
  1565.       beq    retz        | multiply by zero
  1566. ***************
  1567. *** 193,199 ****
  1568.       swap    d5        |  with a denormalized number; there''s an
  1569.       movew    d5,d4        |  eventual loss of 4 bits in the rounding
  1570.       clrw    d5        |  byte -- what a pity 8-)
  1571. !     subw    #16,d0        | decrement exponent
  1572.       bra    2b
  1573.   3:
  1574.       movel    d5,d1        | get rounding bits
  1575. --- 200,207 ----
  1576.       swap    d5        |  with a denormalized number; there''s an
  1577.       movew    d5,d4        |  eventual loss of 4 bits in the rounding
  1578.       clrw    d5        |  byte -- what a pity 8-)
  1579. !     subqw    #8,d0        | decrement exponent
  1580. !     subqw    #8,d0
  1581.       bra    2b
  1582.   3:
  1583.       movel    d5,d1        | get rounding bits
  1584. ***************
  1585. *** 202,214 ****
  1586.       andl    #0xffffff00,d3
  1587.       beq    4f
  1588.       orb    #1,d1        | set "sticky bit" if any low-order set
  1589. ! 4:    addw    #8,sp        | remove accumulator from stack
  1590.       jmp    norm_sf        | (result in d4)
  1591.   
  1592. ! retz:    moveq    #0,d0        | save zero as result
  1593.       lslw    #1,d2        | and set it sign as for d2
  1594.       roxrl    #1,d0
  1595. -     addw    #8,sp
  1596.       moveml    sp@+,d2-d5
  1597.       rts            | no normalizing neccessary
  1598.   
  1599. --- 210,222 ----
  1600.       andl    #0xffffff00,d3
  1601.       beq    4f
  1602.       orb    #1,d1        | set "sticky bit" if any low-order set
  1603. ! 4:    addqw    #8,sp        | remove accumulator from stack
  1604.       jmp    norm_sf        | (result in d4)
  1605.   
  1606. ! retz:    addqw    #8,sp        | release accumulator space
  1607. ! retzz:    moveq    #0,d0        | save zero as result
  1608.       lslw    #1,d2        | and set it sign as for d2
  1609.       roxrl    #1,d0
  1610.       moveml    sp@+,d2-d5
  1611.       rts            | no normalizing neccessary
  1612.   
  1613. ===================================================================
  1614. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/a64l.c,v
  1615. retrieving revision 1.1
  1616. diff -c -r1.1 a64l.c
  1617. *** 1.1    1993/05/21 12:58:12
  1618. --- a64l.c    1993/07/10 16:36:33
  1619. ***************
  1620. *** 56,61 ****
  1621. --- 56,62 ----
  1622.       Hildo Biersma, with the help of a UN*X System V man page.
  1623.   */
  1624.   
  1625. + #include <support.h>
  1626.   #include <errno.h>
  1627.   extern int errno;
  1628.   
  1629. ===================================================================
  1630. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/calloc.c,v
  1631. retrieving revision 1.2
  1632. diff -c -r1.2 calloc.c
  1633. *** 1.2    1992/09/14 14:56:40
  1634. --- calloc.c    1993/07/10 16:36:34
  1635. ***************
  1636. *** 21,27 ****
  1637.   {
  1638.     void *r;
  1639.     unsigned long total;
  1640. -   extern void _bzero();
  1641.   
  1642.     total = n * sz;
  1643.     if ((r = _malloc(total)) != NULL) {
  1644. --- 21,26 ----
  1645. ===================================================================
  1646. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/chdir.c,v
  1647. retrieving revision 1.11
  1648. diff -c -r1.11 chdir.c
  1649. *** 1.11    1992/06/24 15:32:04
  1650. --- chdir.c    1993/07/10 16:36:36
  1651. ***************
  1652. *** 30,37 ****
  1653.           d+=2;
  1654.           (void)Dsetdrv(drv);
  1655.       }
  1656. -     else
  1657. -         drv = old;
  1658.   
  1659.       if (!*d) {        /* empty path means root directory */
  1660.           *d = '\\';
  1661. --- 30,35 ----
  1662. ===================================================================
  1663. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/chmod.c,v
  1664. retrieving revision 1.8
  1665. diff -c -r1.8 chmod.c
  1666. *** 1.8    1992/09/14 14:56:40
  1667. --- chmod.c    1993/07/10 16:36:37
  1668. ***************
  1669. *** 70,76 ****
  1670.       if (__mint >= 9) {
  1671.           (void)_unx2dos(_name, name);
  1672.           r = (int)Fchown(name, uid, gid);
  1673. !         if (r) {
  1674.               errno = -r;
  1675.               return -1;
  1676.           }
  1677. --- 70,76 ----
  1678.       if (__mint >= 9) {
  1679.           (void)_unx2dos(_name, name);
  1680.           r = (int)Fchown(name, uid, gid);
  1681. !         if (r && (r != -EINVAL)) {
  1682.               errno = -r;
  1683.               return -1;
  1684.           }
  1685. ===================================================================
  1686. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/doprnt.c,v
  1687. retrieving revision 1.23
  1688. diff -c -r1.23 doprnt.c
  1689. *** 1.23    1993/05/21 12:55:09
  1690. --- doprnt.c    1993/07/10 16:51:54
  1691. ***************
  1692. *** 368,374 ****
  1693.               if ((((unsigned long)_dd.i[0] > INF_HI) &&
  1694.   /* mj: check for a negative zero; it is not smaller than zero, so it
  1695.      was not negated */
  1696. !                  (_dd.i[0] != 0x80000000 || _dd.i[1] != 0)) ||
  1697.                   ((unsigned long)_dd.i[0] == INF_HI &&
  1698.                    (unsigned long)_dd.i[1] > INF_LO))
  1699.                 {
  1700. --- 368,374 ----
  1701.               if ((((unsigned long)_dd.i[0] > INF_HI) &&
  1702.   /* mj: check for a negative zero; it is not smaller than zero, so it
  1703.      was not negated */
  1704. !                  (_dd.i[0] != 0x80000000L || _dd.i[1] != 0)) ||
  1705.                   ((unsigned long)_dd.i[0] == INF_HI &&
  1706.                    (unsigned long)_dd.i[1] > INF_LO))
  1707.                 {
  1708. ***************
  1709. *** 524,534 ****
  1710.                * fieldsz excludes decimal prec; realsz includes it
  1711.                */
  1712.               fieldsz = size + fpprec;
  1713.               if (sign)
  1714. !                 fieldsz++;
  1715.               if (flags & HEXPREFIX)
  1716. !                 fieldsz += 2;
  1717. !             realsz = dprec > fieldsz ? dprec : fieldsz;
  1718.   
  1719.               /* right-adjusting blank padding */
  1720.               if ((flags & (LADJUST|ZEROPAD)) == 0 && width)
  1721. --- 524,534 ----
  1722.                * fieldsz excludes decimal prec; realsz includes it
  1723.                */
  1724.               fieldsz = size + fpprec;
  1725. +             realsz = dprec > fieldsz ? dprec : fieldsz;
  1726.               if (sign)
  1727. !                 realsz++;
  1728.               if (flags & HEXPREFIX)
  1729. !                 realsz += 2;
  1730.   
  1731.               /* right-adjusting blank padding */
  1732.               if ((flags & (LADJUST|ZEROPAD)) == 0 && width)
  1733. ***************
  1734. *** 609,638 ****
  1735.   
  1736.   /* static */ void Format __PROTO ((double number, char *buf));
  1737.   
  1738. ! asm ("
  1739. ! comm = -6;
  1740. ! resp = -16;
  1741. ! .text
  1742. ! .even
  1743. ! _Format:
  1744. !     lea    0xfffffa50:w,a0            | fpu address
  1745. !     lea    sp@(4),a1            | argptr
  1746. !     movew    #0x5400,a0@(comm)        | fmoved -> fp0
  1747. ! 1:    cmpw    #0x8900,a0@(resp)
  1748. !     beq    1b
  1749. !     movel    a1@+,a0@
  1750. !     movel    a1@+,a0@
  1751. !     movel    a1@,a1                | get buf
  1752. !     movew    #0x6c11,a0@(comm)        | fmovep fp0,a1@{#17}
  1753. ! 1:    cmpw    #0x8900,a0@(resp)
  1754. !     beq    1b
  1755. !     movel    a0@,a1@+
  1756. !     movel    a0@,a1@+
  1757. !     movel    a0@,a1@+
  1758. !     rts
  1759. ! ");
  1760.   #endif /* sfp004 */
  1761.       
  1762.   static int
  1763. --- 609,638 ----
  1764.   
  1765.   /* static */ void Format __PROTO ((double number, char *buf));
  1766.   
  1767. ! asm (
  1768. ! "comm = -6;\n"
  1769. ! "resp = -16;\n"
  1770. ! ".text\n"
  1771. ! ".even\n"
  1772. ! "_Format:\n"
  1773. ! "    lea    0xfffffa50:w,a0            | fpu address\n"
  1774. ! "    lea    sp@(4),a1            | argptr\n"
  1775. ! "    movew    #0x5400,a0@(comm)        | fmoved -> fp0\n"
  1776. ! "1:    cmpw    #0x8900,a0@(resp)\n"
  1777. ! "    beq    1b\n"
  1778. ! "    movel    a1@+,a0@\n"
  1779. ! "    movel    a1@+,a0@\n"
  1780. ! "    movel    a1@,a1                | get buf\n"
  1781. ! "    movew    #0x6c11,a0@(comm)        | fmovep fp0,a1@{#17}\n"
  1782. ! "1:    cmpw    #0x8900,a0@(resp)\n"
  1783. ! "    beq    1b\n"
  1784. ! "    movel    a0@,a1@+\n"
  1785. ! "    movel    a0@,a1@+\n"
  1786. ! "    movel    a0@,a1@+\n"
  1787. ! "    rts\n"
  1788. ! );
  1789.   #endif /* sfp004 */
  1790.       
  1791.   static int
  1792. ===================================================================
  1793. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/eprintf.c,v
  1794. retrieving revision 1.2
  1795. diff -c -r1.2 eprintf.c
  1796. *** 1.2    1992/06/03 14:48:43
  1797. --- eprintf.c    1993/07/10 16:36:40
  1798. ***************
  1799. *** 1,6 ****
  1800. - #include <stdio.h>
  1801.   #include <stdarg.h>
  1802.   #include <string.h>
  1803.   #include "lib.h"
  1804.   
  1805.   /* new file 4/15/92 sb
  1806. --- 1,6 ----
  1807.   #include <stdarg.h>
  1808.   #include <string.h>
  1809. + #include <assert.h>
  1810.   #include "lib.h"
  1811.   
  1812.   /* new file 4/15/92 sb
  1813. ***************
  1814. *** 12,24 ****
  1815.   
  1816.      5/2/92 sb
  1817.      Modified to do its own work rather than call fprintf().
  1818. - */
  1819.   
  1820. ! static char buf[20];    /* big enough for any value of a long */
  1821.   
  1822.   static void _say(s)
  1823. ! char *s;
  1824.   {
  1825.       _write(2,s,(long)(strlen(s)));
  1826.   }
  1827. --- 12,26 ----
  1828.   
  1829.      5/2/92 sb
  1830.      Modified to do its own work rather than call fprintf().
  1831.   
  1832. !    5/4/93 uo
  1833. !    Threw away a static buffer.
  1834. ! */
  1835. !   
  1836. ! static void _say __PROTO((const char *s));
  1837.   
  1838.   static void _say(s)
  1839. ! const char *s;
  1840.   {
  1841.       _write(2,s,(long)(strlen(s)));
  1842.   }
  1843. ***************
  1844. *** 29,34 ****
  1845. --- 31,38 ----
  1846.   const long line;
  1847.   const char *filename;
  1848.   {
  1849. +     char buf[20];
  1850.       _ltoa(line, buf, 10);
  1851.       _say("assertion `");
  1852.       _say(expression);
  1853. ===================================================================
  1854. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/findfile.c,v
  1855. retrieving revision 1.11
  1856. diff -c -r1.11 findfile.c
  1857. *** 1.11    1992/09/14 14:56:40
  1858. --- findfile.c    1993/07/13 17:03:43
  1859. ***************
  1860. *** 7,16 ****
  1861. --- 7,19 ----
  1862.      Returns the name by which the file was found, or NULL.
  1863.   
  1864.      Written by Eric R. Smith and placed in the public domain.
  1865. +    rehacked by Uwe Ohse, 28.4.93, to support reentrant spawn/popen.
  1866.   */
  1867.   
  1868.   #include <compiler.h>
  1869.   #include <limits.h>    /* needed for PATH_MAX */
  1870. + #include <support.h>
  1871.   #include <stddef.h>
  1872.   #include <types.h>
  1873.   #include <stat.h>
  1874. ***************
  1875. *** 27,33 ****
  1876.   static char *nullext[] = { NULL };
  1877.   
  1878.   static int EXISTS __PROTO((char *));
  1879. - char *findfile __PROTO((char *fname, char *fpath, char **fext));
  1880.   
  1881.   static int
  1882.   EXISTS(name)
  1883. --- 30,35 ----
  1884. ***************
  1885. *** 42,81 ****
  1886.       return 1;
  1887.   }
  1888.   
  1889.   char *
  1890.   findfile(fname, fpath, fext)
  1891.           char *fname, *fpath, **fext;
  1892.   {
  1893. !         static char try[PATH_MAX];
  1894. !         char *s, *t, *extplace, **nextext, c;
  1895. !         int  hasext = 0, haspath = 0;
  1896.   
  1897.       if (!fname || !*fname)
  1898.           return NULL;
  1899.   
  1900. !         s = try; t = fname;
  1901.   
  1902.   /* copy the file in, checking to see if a path and/or extension are already
  1903.      given */
  1904.   
  1905. !         while ( (c = *t++) != 0 ) {
  1906. !                 if (c == DIRSEP1 || c == DIRSEP2) {
  1907. !                         haspath = 1; hasext = 0;
  1908. !                 }
  1909. !                 else if (c == '.')
  1910. !                         hasext = 1;
  1911. !                 *s++ = c;
  1912. !         }
  1913. !         extplace = s;
  1914. !         *s++ = 0;
  1915. !         if (haspath || !fpath)
  1916. !                 fpath = "";
  1917. !         if (hasext || !fext)
  1918. !                 fext = nullext;
  1919.   
  1920. !         for(;;) {               /* loop on path elements */
  1921. !                 nextext = fext;
  1922.           if (!hasext) {
  1923.               extplace[0] = 0;
  1924.               extplace[1] = 0;
  1925. --- 44,96 ----
  1926.       return 1;
  1927.   }
  1928.   
  1929.   char *
  1930.   findfile(fname, fpath, fext)
  1931.           char *fname, *fpath, **fext;
  1932.   {
  1933. !       /* simply calls buffindfile */
  1934. !       static char try[PATH_MAX];
  1935. !       return buffindfile(fname,fpath,fext,try);
  1936. ! }
  1937. ! char *
  1938. ! buffindfile(fname, fpath, fext, try)
  1939. !       char *fname, *fpath, **fext, *try;
  1940. ! {
  1941. !       char *s, *t, *extplace, **nextext, c;
  1942. !       int  hasext = 0, haspath = 0;
  1943.   
  1944.       if (!fname || !*fname)
  1945.           return NULL;
  1946.   
  1947. !       s = try; t = fname;
  1948.   
  1949.   /* copy the file in, checking to see if a path and/or extension are already
  1950.      given */
  1951.   
  1952. !       while ( (c = *t++) != 0 )
  1953. !       {
  1954. !               if (c == DIRSEP1 || c == DIRSEP2)
  1955. !               {
  1956. !                       haspath = 1;
  1957. !                       hasext = 0;
  1958. !               }
  1959. !               else if (c == '.')
  1960. !                       hasext = 1;
  1961. !               *s++ = c;
  1962. !       }
  1963. !       extplace = s;
  1964. !       *s++ = 0;
  1965. !       if (haspath || !fpath)
  1966. !               fpath = "";
  1967. !       if (hasext || !fext)
  1968. !               fext = nullext;
  1969.   
  1970. !       for(;;) {               /* loop on path elements */
  1971. !               nextext = fext;
  1972.           if (!hasext) {
  1973.               extplace[0] = 0;
  1974.               extplace[1] = 0;
  1975. ***************
  1976. *** 84,107 ****
  1977.           if (EXISTS(try))
  1978.               return try;
  1979.           extplace[0] = '.';
  1980. !                 while(*nextext) {       /* loop on extensions */
  1981. !                         (void)strcpy(&extplace[1], *nextext++);
  1982. !                         if (EXISTS(try))
  1983. !                                 return try;
  1984. !                 }
  1985. !                 if (!*fpath) break;  /* no more places to look */
  1986.   
  1987.   /* copy in next element of path list */
  1988. !                 s = try;
  1989. !                 while ((c = *fpath) != 0 && c != PATHSEP1 && c != PATHSEP2) {
  1990. !                         *s++ = c;
  1991. !                         fpath++;
  1992. !                 }
  1993. !                 if (c) fpath++;
  1994. !                 *s++ = DIRSEP1;
  1995. !                 t = fname;
  1996. !                 while ((*s++ = *t++) != 0) ;
  1997. !                 extplace = --s ;        /* where the extension gets written */
  1998. !         }
  1999. !         return NULL;
  2000.   }
  2001. --- 99,134 ----
  2002.           if (EXISTS(try))
  2003.               return try;
  2004.           extplace[0] = '.';
  2005. !               while(*nextext) {       /* loop on extensions */
  2006. !                       (void)strcpy(&extplace[1], *nextext++);
  2007. !                       if (EXISTS(try))
  2008. !                               return try;
  2009. !               }
  2010. !               if (!*fpath) break;  /* no more places to look */
  2011.   
  2012.   /* copy in next element of path list */
  2013. !               s = try;
  2014. !         /* an attempt to accomodate within reason TOS specs  -- mj */
  2015. !         if (*(fpath + 1) == ':') {
  2016. !             if ((*(fpath + 2) == DIRSEP1 ||
  2017. !                  *(fpath + 2) == DIRSEP2)   &&
  2018. !                 (*fpath != '.' && *fpath != ':')) {
  2019. !                 *s++ = *fpath++;
  2020. !                 *s++ = *fpath++;
  2021. !                 *s++ = *fpath++;
  2022. !             }
  2023. !         }
  2024. !               while ((c = *fpath) != 0 && c != PATHSEP1 && c != PATHSEP2) {
  2025. !                       *s++ = c;
  2026. !                       fpath++;
  2027. !               }
  2028. !               if (c)
  2029. !                       fpath++;
  2030. !               *s++ = DIRSEP1;
  2031. !               t = fname;
  2032. !               while ((*s++ = *t++) != 0)
  2033. !                       ;
  2034. !               extplace = --s ;        /* where the extension gets written */
  2035. !       }
  2036. !       return NULL;
  2037.   }
  2038. ===================================================================
  2039. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fopen.c,v
  2040. retrieving revision 1.19
  2041. diff -c -r1.19 fopen.c
  2042. *** 1.19    1993/03/01 17:34:29
  2043. --- fopen.c    1993/07/10 16:36:41
  2044. ***************
  2045. *** 64,69 ****
  2046. --- 64,70 ----
  2047.           iomode |= O_WRONLY;
  2048.       else
  2049.           iomode |= O_RDWR;
  2050. +     iomode |= O_NOCTTY;
  2051.       h = open(filename, iomode, 0644);
  2052.       if(h < __SMALLEST_VALID_HANDLE)
  2053.           {
  2054. ===================================================================
  2055. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fread.c,v
  2056. retrieving revision 1.16
  2057. diff -c -r1.16 fread.c
  2058. *** 1.16    1993/02/18 00:00:23
  2059. --- fread.c    1993/07/10 16:36:42
  2060. ***************
  2061. *** 2,7 ****
  2062. --- 2,11 ----
  2063.    * from Dale Schumacher's dLibs
  2064.    */
  2065.   
  2066. + /* 5/26/93 sb -- Modified for HSC to account for the possibility that
  2067. +  * size * count >= 64K.
  2068. +  */
  2069.   #include <stddef.h>
  2070.   #include <stdio.h>
  2071.   #include <unistd.h>
  2072. ***************
  2073. *** 18,24 ****
  2074. --- 22,32 ----
  2075.       size_t count;
  2076.       register FILE *fp;
  2077.       {
  2078. + #ifdef __SOZOBON__
  2079. +     register unsigned long n;
  2080. + #else
  2081.       register size_t n;
  2082. + #endif
  2083.       register long l, cnt;
  2084.       register unsigned int f;
  2085.       char *data=_data;
  2086. ***************
  2087. *** 33,39 ****
  2088. --- 41,51 ----
  2089.           return(0);
  2090.   
  2091.       l = 0;
  2092. + #ifdef __SOZOBON__
  2093. +     n = (unsigned long)count * size;
  2094. + #else
  2095.       n = count * size;
  2096. + #endif
  2097.   #if 0
  2098.       if(fflush(fp))            /* re-sync file pointers */
  2099.           return 0;
  2100. ***************
  2101. *** 44,50 ****
  2102. --- 56,66 ----
  2103.       if((cnt = fp->_cnt) > 0)
  2104.       {
  2105.           cnt = (cnt < n) ? cnt : n;
  2106. + #ifdef __SOZOBON__
  2107. +         _bcopy(fp->_ptr, data, cnt);
  2108. + #else
  2109.           bcopy(fp->_ptr, data, cnt);
  2110. + #endif
  2111.           fp->_cnt -= cnt;
  2112.           fp->_ptr += cnt;
  2113.           l += cnt;
  2114. ***************
  2115. *** 138,142 ****
  2116. --- 154,162 ----
  2117.       }
  2118.   
  2119.       ret:
  2120. + #ifdef __SOZOBON__
  2121. +     return((l > 0) ? ((size_t)((unsigned long)l / size)) : 0);
  2122. + #else
  2123.       return((l > 0) ? ((size_t)l / size) : 0);
  2124. + #endif
  2125.       }
  2126. ===================================================================
  2127. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/frexp.cpp,v
  2128. retrieving revision 1.7
  2129. diff -c -r1.7 frexp.cpp
  2130. *** 1.7    1993/05/29 20:28:43
  2131. --- frexp.cpp    1993/07/13 17:03:44
  2132. ***************
  2133. *** 174,179 ****
  2134. --- 174,180 ----
  2135.   
  2136.   .globl _frexp
  2137.   
  2138. + _frexp:
  2139.       tstl    sp@(4)        | 1st arg == 0 ?
  2140.       bne    nonzero
  2141.       tstl    sp@(8)
  2142. ***************
  2143. *** 210,216 ****
  2144.       .long    0x0c688900, 0xfff067f8
  2145.       movew    a0@,a1@            | return exp
  2146.   #else
  2147. !     movew    #0x7880,a0@(comm)    | fetch exp (fmovel from fp1)
  2148.       .long    0x0c688900, 0xfff067f8
  2149.       movel    a0@,a1@            | return exp
  2150.   #endif
  2151. --- 211,217 ----
  2152.       .long    0x0c688900, 0xfff067f8
  2153.       movew    a0@,a1@            | return exp
  2154.   #else
  2155. !     movew    #0x6080,a0@(comm)    | fetch exp (fmovel from fp1)
  2156.       .long    0x0c688900, 0xfff067f8
  2157.       movel    a0@,a1@            | return exp
  2158.   #endif
  2159. ===================================================================
  2160. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/fwrite.c,v
  2161. retrieving revision 1.13
  2162. diff -c -r1.13 fwrite.c
  2163. *** 1.13    1992/09/14 14:56:40
  2164. --- fwrite.c    1993/07/10 16:36:44
  2165. ***************
  2166. *** 1,5 ****
  2167. --- 1,9 ----
  2168.   /* from Dale Schumacher's dLibs */
  2169.   
  2170. + /* 5/26/93 sb -- Modified for HSC to account for the possibility that
  2171. +  * size * count >= 64K.
  2172. +  */
  2173.   #include <stddef.h>
  2174.   #include <stdio.h>
  2175.   #include <unistd.h>
  2176. ***************
  2177. *** 17,23 ****
  2178. --- 21,31 ----
  2179.   register FILE *fp;
  2180.   {
  2181.       const char *data=_data;
  2182. + #ifdef __SOZOBON__
  2183. +     register unsigned long n, m;
  2184. + #else
  2185.       register size_t n, m;
  2186. + #endif
  2187.       register long l = 0;
  2188.       long space;
  2189.       unsigned int f = fp->_flag;
  2190. ***************
  2191. *** 38,52 ****
  2192. --- 46,69 ----
  2193.   
  2194.       assert ((data != NULL));
  2195.       assert ((size != 0));
  2196. + #ifdef __SOZOBON__
  2197. +     n =  (unsigned long)count * size;
  2198. +     assert ( n <= (unsigned_long)LONG_MAX);  /* otherwise impl will not work */
  2199. + #else
  2200.       n =  count * size;
  2201.       assert ( n <= (size_t)LONG_MAX);  /* otherwise impl will not work */
  2202. + #endif
  2203.   
  2204.       if( (f&_IOBIN) || __FRW_BIN__ ) {
  2205.         space = fp->_bsiz - fp->_cnt;
  2206.         while(n > 0)
  2207.         {
  2208.             m = (n > space)? space: n;
  2209. + #ifdef __SOZOBON__
  2210. +           _bcopy(data, fp->_ptr, m);
  2211. + #else
  2212.             bcopy(data, fp->_ptr, m);
  2213. + #endif
  2214.             fp->_ptr += m;
  2215.             fp->_cnt += m;
  2216.             space -= m;
  2217. ***************
  2218. *** 77,84 ****
  2219.         line_flush=0;
  2220.         /* this relies on having at least one byte buffer,
  2221.            otherwise we'll hang up when trying to write CRLF */
  2222. !       while(n > 0)
  2223. !       {
  2224.             space = fp->_bsiz - fp->_cnt;
  2225.             restart_buf=data;
  2226.             while( space>0 && n>0 ) {
  2227. --- 94,100 ----
  2228.         line_flush=0;
  2229.         /* this relies on having at least one byte buffer,
  2230.            otherwise we'll hang up when trying to write CRLF */
  2231. !       while(n > 0) {
  2232.             space = fp->_bsiz - fp->_cnt;
  2233.             restart_buf=data;
  2234.             while( space>0 && n>0 ) {
  2235. ***************
  2236. *** 120,134 ****
  2237.               n--;
  2238.               data++;
  2239.             }
  2240. !           if( (m=_write(fp->_file, restart_buf, data-restart_buf ))
  2241. !               != data-restart_buf ) {
  2242.               fp->_flag |= _IOERR;
  2243.               return 0;
  2244.             }
  2245. !           l+=m;
  2246.           }
  2247.             }
  2248. !       }
  2249.         if( line_flush ) {
  2250.            if(fflush(fp))
  2251.            return 0;
  2252. --- 136,151 ----
  2253.               n--;
  2254.               data++;
  2255.             }
  2256. !           if( (m = _write(fp->_file, restart_buf, data - restart_buf))
  2257. !               != data - restart_buf) {
  2258.               fp->_flag |= _IOERR;
  2259.               return 0;
  2260.             }
  2261. !           l += (m - 1); /* we already counted one character, before
  2262. !                  * decrementing 'space' to zero */
  2263.           }
  2264.             }
  2265. !       } /* while */
  2266.         if( line_flush ) {
  2267.            if(fflush(fp))
  2268.            return 0;
  2269. ***************
  2270. *** 137,141 ****
  2271. --- 154,162 ----
  2272.         }
  2273.       }
  2274.   
  2275. + #ifdef __SOZOBON
  2276. +     return((l > 0) ? ((size_t)((unsigned long)l / size)) : 0);
  2277. + #else
  2278.       return((l > 0) ? ((size_t)l / size) : 0);
  2279. + #endif
  2280.   }
  2281. ===================================================================
  2282. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getpw.c,v
  2283. retrieving revision 1.11
  2284. diff -c -r1.11 getpw.c
  2285. *** 1.11    1992/09/14 14:56:40
  2286. --- getpw.c    1993/07/10 16:36:45
  2287. ***************
  2288. *** 31,212 ****
  2289.   
  2290.   /* minorly customized by ERS for the MiNT library */
  2291.   
  2292.   #include <stdio.h>
  2293.   #include <pwd.h>
  2294.   #include <unistd.h>
  2295.   #include <string.h>
  2296.   #include <stdlib.h>
  2297.   
  2298. ! static char *pwdfile = "/etc/passwd";    /* default passwd file */
  2299.   
  2300.   static FILE *fp = NULL;
  2301. ! static struct passwd curentry;        /* static data to return */
  2302.   
  2303. ! static int nextent __PROTO((void));
  2304.   
  2305. ! void setpwfile (cp)
  2306.   char *cp;
  2307.   {
  2308. !     endpwent();
  2309. !     if(cp) pwdfile = cp;
  2310. ! }
  2311. ! void setpwent ()
  2312. ! {
  2313. !     if (fp)
  2314. !         rewind (fp);
  2315. ! #ifdef atarist
  2316. !     else if ((fp = fopen (pwdfile, "rt")) == NULL)
  2317. ! #else
  2318. !     else if ((fp = fopen (pwdfile, "r")) == NULL)
  2319. ! #endif
  2320. !     {
  2321.   #ifdef VERBOSE
  2322. !         fprintf (stderr,
  2323. !             "setpwent: %s non-existant or unreadable.\n", pwdfile);
  2324.   #endif
  2325. !     }
  2326. ! }
  2327.   
  2328. ! void endpwent ()
  2329.   {
  2330. !     if (fp)
  2331. !     {
  2332. !         fclose (fp);
  2333. !         fp = NULL;
  2334. !     }
  2335. ! }
  2336.   
  2337. ! struct passwd *getpwent ()
  2338.   {
  2339. !     if (! fp ) {
  2340. !         setpwent();
  2341. !         if (! fp )
  2342. !             return (NULL);
  2343. !     }
  2344. !     if (! nextent ())
  2345. !         return (NULL);
  2346. !     else
  2347. !         return (& curentry);
  2348. ! }
  2349. ! struct passwd *getpwuid (uid)
  2350. ! register int uid;
  2351.   {
  2352. !     setpwent ();
  2353. !     while (nextent ())
  2354. !         if (curentry.pw_uid == uid)
  2355. !             return (& curentry);
  2356. !     return (NULL);
  2357. ! }
  2358.   
  2359. ! struct passwd *getpwnam (name)
  2360. ! register const char *name;
  2361.   {
  2362. !     setpwent ();
  2363.   
  2364. !     while (nextent ())
  2365. !         if (strcmp (curentry.pw_name, name) == 0)
  2366. !             return (& curentry);
  2367.   
  2368. !     return (NULL);
  2369. ! }
  2370.   
  2371. ! #ifdef atarist
  2372. ! static char savbuf[256];    /* BUFSIZ seems bigger than necessary! */
  2373.   #else
  2374.   static char savbuf[BUFSIZ];
  2375.   #endif
  2376. !         
  2377. ! static int nextent ()
  2378.   {
  2379. !     register char *cp;
  2380.   
  2381. !     if (! fp ) {
  2382. !         setpwent ();
  2383. !         if (! fp )
  2384. !             return (0);
  2385. !     }
  2386. !     while (fgets (savbuf, (int)sizeof(savbuf), fp) != NULL)
  2387. !     {
  2388. !         for (cp = savbuf; *cp && *cp != ':'; cp++)
  2389. !             ;
  2390. !         curentry.pw_name = savbuf;
  2391. !         *cp++ = '\0';
  2392. !         curentry.pw_passwd = cp;
  2393. !         for (; *cp && *cp != ':'; cp++)
  2394. !             ;
  2395. !         *cp++ = '\0';
  2396. !         curentry.pw_uid = atoi (cp);
  2397. !         for (; *cp && *cp != ':'; cp++)
  2398. !             ;
  2399. !         *cp++ = '\0';
  2400. !         curentry.pw_gid = atoi (cp);
  2401. !         for (; *cp && *cp != ':'; cp++)
  2402. !             ;
  2403. !         *cp++ = '\0';
  2404. !         curentry.pw_gecos = cp;
  2405. !         for (; *cp && *cp != ':'; cp++)
  2406. !             ;
  2407. !         *cp++ = '\0';
  2408. !         curentry.pw_dir = cp;
  2409. !         for (; *cp && *cp != ':'; cp++)
  2410. !             ;
  2411. !         *cp++ = '\0';
  2412. !         curentry.pw_shell = cp;
  2413. !         for (; *cp && *cp != ':' && *cp != '\n'; cp++)
  2414. !             ;
  2415. !         *cp++ = '\0';
  2416. !         return (1);
  2417. !     }
  2418. !     return (0);
  2419. ! }
  2420. ! #ifdef TEST
  2421. ! main (argc, argv)
  2422. ! int argc;
  2423. ! char **argv;
  2424. ! {
  2425. !     struct passwd *pwd;
  2426. !     if (argc > 1)
  2427. !         setpwfile (argv[1]);
  2428. !     setpwent ();
  2429. !     while ((pwd = getpwent ()) != NULL)
  2430. !     {
  2431. !         printf ("%s:\n\t%s\n\t%d\n\t%d\n\t%s\n\t%s\n\t%s\n",
  2432. !             pwd->pw_name,
  2433. !             pwd->pw_passwd,
  2434. !             pwd->pw_uid,
  2435. !             pwd->pw_gid,
  2436. !             pwd->pw_gecos,
  2437. !             pwd->pw_dir,
  2438. !             pwd->pw_shell);
  2439. !     }
  2440. !     endpwent ();
  2441. !     if (pwd = getpwnam ("operator"))
  2442. !         printf ("%s:\n\t%s\n\t%d\n\t%d\n\t%s\n\t%s\n\t%s\n",
  2443. !             pwd->pw_name,
  2444. !             pwd->pw_passwd,
  2445. !             pwd->pw_uid,
  2446. !             pwd->pw_gid,
  2447. !             pwd->pw_gecos,
  2448. !             pwd->pw_dir,
  2449. !             pwd->pw_shell);
  2450. !     if (pwd = getpwuid (1))
  2451. !         printf ("%s:\n\t%s\n\t%d\n\t%d\n\t%s\n\t%s\n\t%s\n",
  2452. !             pwd->pw_name,
  2453. !             pwd->pw_passwd,
  2454. !             pwd->pw_uid,
  2455. !             pwd->pw_gid,
  2456. !             pwd->pw_gecos,
  2457. !             pwd->pw_dir,
  2458. !             pwd->pw_shell);
  2459. ! }
  2460. ! #endif
  2461. --- 31,458 ----
  2462.   
  2463.   /* minorly customized by ERS for the MiNT library */
  2464.   
  2465. + /****************************************************************/
  2466. + /* Module name:   getpw.c                                       */
  2467. + /* Library name:  mintlibs for Atari ST                         */
  2468. + /* Author:        Hildo Biersma (boender@dutiws.twi.tudelft.nl) */
  2469. + /* Date:          January 29, 1993                              */
  2470. + /* Revision:      1 (add password aging, add System V routines, */
  2471. + /*                   include three man pages, add example code) */
  2472. + /****************************************************************/
  2473. + /*
  2474. + NAME
  2475. +     getpw - get name from UID
  2476. + SYNOPSIS
  2477. +     #include <pwd.h>
  2478. +     int getpw(int uid, char *buf);
  2479. + DESCRIPTION
  2480. +     getpw searches the password file for a user id number that
  2481. +     equals uid, copies the line of the password file in which uid
  2482. +     was found into the array pointed to by buf, and returns 0.
  2483. +     getpw returns non-zero if uid cannot be found.
  2484. +     This routine is included only for compatibility with old UN*X
  2485. +     systems and should not be used in any new programs; see
  2486. +     getpwent for routines to use instead.
  2487. + FILES
  2488. +     /etc/passwd
  2489. + SEE ALSO
  2490. +     getpwent
  2491. + AUTHOR
  2492. +     Hildo Biersma, with the help of a UN*X System V man page.
  2493. + */
  2494. + /*
  2495. + NAME
  2496. +     getpwent, getpwuid, getpwnam, setpwent, endpwent,
  2497. +     fgetpwent, setpwfile - get password file entry
  2498. + SYNOPSIS
  2499. +     #include <stdio.h>  // Only needed for fgetpwent
  2500. +     #include <pwd.h>
  2501. +     struct passwd *getpwent(void);
  2502. +     struct passwd *getpwuid(int uid);
  2503. +     struct passwd *getpwnam(const char *name);
  2504. +     void setpwent(void);
  2505. +     void endpwent(void);
  2506. +     struct passwd *fgetpwent(FILE *f);
  2507. +     void setpwfile(const char *name);
  2508. + DESCRIPTION
  2509. +     getpwent, getpwuid and getpwnam each returns a pointer to an
  2510. +     object containing the broken-out fields of a line in the
  2511. +     /etc/passwd file.
  2512. +     Each line in the file contains a "passwd" structure, declared
  2513. +     in the <pwd.h> header file. For the definition of this structure
  2514. +     and the meaning of the fields, see the <pwd.h> header file.
  2515. +     getpwent when first called returns a pointer to the first
  2516. +     passwd structure in the file; thereafter, it returns a pointer
  2517. +     to the next passwd structure in the file; so successive calls
  2518. +     can be used to search the entire file.
  2519. +     getpwuid searches from the beginning of the file until a
  2520. +     numerical user ID is found matching uid is found and returns
  2521. +     a pointer to the particular structure in which it was found.
  2522. +     Thus, it cannot be found to search for several users having
  2523. +     duplicate numerical user IDs.
  2524. +     getpwnam searches from the beginning of the file until a
  2525. +     login name matching name is found and returns a pointer to
  2526. +     the particular structure in which it was found.
  2527. +     If an EOF or an error is encountered on reading, getpwent,
  2528. +     getpwuid and getpwnam return a NULL pointer.
  2529. +     A call to setpwent has the effect of rewinding the password
  2530. +     file to allow repeated searches.
  2531. +     endpwent may be called to close the password file when
  2532. +     processing is complete.
  2533. +     fgetpwent returns a pointer to the next passwd structure in
  2534. +     the stream f, which matches the format of /etc/passwd.
  2535. +     setpwfile will set the password file to be read from by all
  2536. +     the above routines except fgetpwent.   
  2537. + FILES
  2538. +     /etc/passwd
  2539. + SEE ALSO
  2540. +     getlogin, getgrent, putpwent
  2541. + NOTES
  2542. +     All information is contained in a static area, so it must
  2543. +     be copied if it is to be saved.
  2544. +     Password aging is supported.
  2545. +     In order not to suffer from possible future changes in the
  2546. +     format of the passwd file or in the passwd structure,
  2547. +     these routines should always be used for reading from file,
  2548. +     while putpwent should always be used for writing to file.
  2549. +     These routines expect the passwd file to be of type text,
  2550. +     and can therefore read both DOS and UN*X format files.
  2551. + AUTHORS
  2552. +     Arnold D. Robbins - original version
  2553. +     Eric Smith        - adapted for the mintlibs
  2554. +     Hildo Biersma     - included System V routines and password aging
  2555. + */
  2556. + /*
  2557. + PASSWORD AGING
  2558. + DESCRIPTION
  2559. +     Password aging is in effect for a particular user if his
  2560. +     encrypted password in the password file is followed by a
  2561. +     comma and a non-null string of characters from the 
  2562. +     alphabet (., /, 0-9, A-Z, a-z) also used for the encrypted
  2563. +     password. (Such a string must be introduced in the first
  2564. +     place by the super-user.)
  2565. +     The first character of the age, M say, denotes the maximum
  2566. +     number of weeks for which a password is valid. A user who
  2567. +     attempts to login after his password has expired should be
  2568. +     forced to supply a new one. The next character, N say,
  2569. +     denotes the minimum number of weeks which must expire
  2570. +     before the password may be changed. The remaining characters
  2571. +     define the week (counted from the beginning of 1970) when
  2572. +     the password was last changed. (A null string is equivalent
  2573. +     to zero.) M and N have numerical values in the range 0-63
  2574. +     that correspond to the 64-character alphabet mentioned
  2575. +     above (i.e., / = 1 week; z = 63 weeks). If M = N = 0
  2576. +     (derived from the string . or ..) the user should be forced
  2577. +     to change his password the next time he logs in (and the
  2578. +     "age" should disappear from his entry in the password file).
  2579. +     If N > M (signified, e.g., by the string /.) only the
  2580. +     super-user should be able to change the password.
  2581. + SEE ALSO
  2582. +     a64l, getpwent, putpwent
  2583. + NOTE
  2584. +     The compliance with password aging in MiNT is a joke, since
  2585. +     users are not forced to login. Also, the current login program
  2586. +     supplied in init(1) does not support password aging. This may
  2587. +     change in the future.
  2588. + */
  2589. + /*
  2590. +   FIXME:
  2591. +   - test *thoroughly*
  2592. +   - write example code for modifying passwd files, include below
  2593. + */  
  2594. +     
  2595.   #include <stdio.h>
  2596.   #include <pwd.h>
  2597.   #include <unistd.h>
  2598.   #include <string.h>
  2599.   #include <stdlib.h>
  2600.   
  2601. ! static char *pwdfile = "/etc/passwd"; /* default passwd file */
  2602.   
  2603.   static FILE *fp = NULL;
  2604. ! static struct passwd curentry;    /* static data to return */
  2605.   
  2606. ! static int nextent __PROTO((FILE *fp));
  2607.   
  2608. ! /* Get name from uid */
  2609. ! int getpw(uid, buf)
  2610. ! int uid;
  2611. ! char *buf;
  2612. ! {
  2613. !   FILE *pw;
  2614. !   char line[256]; /* Assume this will always be enough */
  2615. !   char *ptr;
  2616. !   if ((pw = fopen("/etc/passwd", "rt")) == NULL)
  2617. !     return(-1); /* Failure: file could not be opened */
  2618. !   line[255] = 0x00;
  2619. !   while (!feof(pw))
  2620. !   {
  2621. !     fgets(line, 255, pw);
  2622. !     if ((ptr = strchr(line, ':')) != NULL) /* Password field found */
  2623. !       if ((ptr = strchr(ptr + 1, ':')) != NULL) /* UID field found */
  2624. !         if (atoi(ptr + 1) == uid)
  2625. !         {
  2626. !           strcpy(buf, line);
  2627. !           return(0); /* Success */
  2628. !         }
  2629. !   }
  2630. !   return(-1); /* Failure */
  2631. ! } /* End of getpw() */
  2632. ! /* Set the name of the passwd file */
  2633. ! void setpwfile(cp)
  2634.   char *cp;
  2635.   {
  2636. !   endpwent();
  2637. !   if (cp != NULL)
  2638. !     pwdfile = cp;
  2639. ! } /* End of setpwfile() */
  2640. ! /* Rewind the passwd file */
  2641. ! void setpwent()
  2642. ! {
  2643. !   if (fp != NULL)
  2644. !     rewind(fp);
  2645. !   else if ((fp = fopen (pwdfile, "rt")) == NULL)
  2646. !   {
  2647.   #ifdef VERBOSE
  2648. !     fprintf (stderr, "setpwent: %s non-existant or unreadable.\n", pwdfile);
  2649.   #endif
  2650. !   }
  2651. ! } /* End of setpwent() */
  2652.   
  2653. ! /* End passwd file processing */
  2654. ! void endpwent()
  2655.   {
  2656. !   if (fp != NULL)
  2657. !   {
  2658. !     fclose (fp);
  2659. !     fp = NULL;
  2660. !   }
  2661. ! } /* End of endpwent() */
  2662.   
  2663. ! /* Get the next passwd entry from the passwd file */
  2664. ! struct passwd *getpwent()
  2665.   {
  2666. !   if (fp == NULL)
  2667. !   {
  2668. !     setpwent();
  2669. !     if (fp == NULL)
  2670. !       return(NULL);
  2671. !   }
  2672. !   if (nextent(fp) == 0)
  2673. !     return(NULL);
  2674. !   else
  2675. !     return(&curentry);
  2676. ! } /* End of getpwent() */
  2677. ! /* Get first passwd entry from file with pw_uid matching uid */
  2678. ! struct passwd *getpwuid(uid)
  2679. ! int uid;
  2680.   {
  2681. !   setpwent();
  2682. !   while (nextent(fp) != 0)
  2683. !     if (curentry.pw_uid == uid)
  2684. !       return(&curentry);
  2685. !   return(NULL);
  2686. ! } /* End of getpwuid() */
  2687. ! /* Get first passwd entry from file with pw_name matching name */
  2688. ! struct passwd *getpwnam(name)
  2689. ! const char *name;
  2690. ! {
  2691. !   setpwent();
  2692.   
  2693. !   while (nextent(fp) != 0)
  2694. !     if (strcmp(curentry.pw_name, name) == 0)
  2695. !       return(&curentry);
  2696. !   return(NULL);
  2697. ! } /* End of getpwnam() */
  2698. ! /* Read the next password structure from a given file */
  2699. ! struct passwd *fgetpwent(f)
  2700. ! FILE *f;
  2701.   {
  2702. !   if (f == NULL)
  2703. !     return(NULL); /* Failure */
  2704.   
  2705. !   if (nextent(f) != 0)
  2706. !     return(&curentry); /* Success */
  2707.   
  2708. !   return(NULL); /* Failure */
  2709. ! } /* End of fgetpwent() */
  2710.   
  2711. ! #if defined(atarist) || defined(__SOZOBON__)
  2712. ! static char savbuf[256];  /* BUFSIZ seems bigger than necessary! */
  2713.   #else
  2714.   static char savbuf[BUFSIZ];
  2715.   #endif
  2716. ! /* Static function getting next entry from passwd file */    
  2717. ! static int nextent(fp)
  2718. ! FILE *fp;
  2719.   {
  2720. !   char *cp;
  2721.   
  2722. !   if (fp == NULL)
  2723. !   {
  2724. !     setpwent();
  2725. !     if (fp == NULL)
  2726. !       return(0);
  2727. !   }
  2728. !   while (fgets(savbuf, (int)sizeof(savbuf), fp) != NULL)
  2729. !   {
  2730. !     curentry.pw_age = NULL;
  2731. !     for (cp = savbuf; ((*cp != 0x00) && (*cp != ':')); cp++)
  2732. !       ;
  2733. !     curentry.pw_name = savbuf;
  2734. !     *cp++ = 0x00;
  2735. !     curentry.pw_passwd = cp;
  2736. !     for (; ((*cp != 0x00) && (*cp != ':')); cp++)
  2737. !       if ((*cp == ',') && (curentry.pw_age == NULL))
  2738. !       {
  2739. !         /* Password age field found */
  2740. !         *cp++ = 0x00;
  2741. !         curentry.pw_age = cp;
  2742. !       }
  2743. !     *cp++ = 0x00;
  2744. !     curentry.pw_uid = atoi(cp);
  2745. !     for (; ((*cp != 0x00) && (*cp != ':')); cp++)
  2746. !       ;
  2747. !     *cp++ = 0x00;
  2748. !     curentry.pw_gid = atoi(cp);
  2749. !     for (; ((*cp != 0x00) && (*cp != ':')); cp++)
  2750. !       ;
  2751. !     *cp++ = 0x00;
  2752. !     curentry.pw_gecos = cp;
  2753. !     curentry.pw_comment = cp;
  2754. !     for (; ((*cp != 0x00) && (*cp != ':')); cp++)
  2755. !       ;
  2756. !     *cp++ = 0x00;
  2757. !     curentry.pw_dir = cp;
  2758. !     for (; ((*cp != 0x00) && (*cp != ':')); cp++)
  2759. !       ;
  2760. !     *cp++ = 0x00;
  2761. !     curentry.pw_shell = cp;
  2762. !     for (; ((*cp != 0x00) && (*cp != ':') && (*cp != '\n')); cp++)
  2763. !       ;
  2764. !     *cp = 0x00;
  2765. !     if (curentry.pw_age == NULL)
  2766. !       curentry.pw_age = cp; /* Don't return NULL, return a null string */
  2767. !     return(1);
  2768. !   }
  2769. !   return(0);
  2770. ! } /* End of nextent() */
  2771. ! /* Old test program removed - Hildo Biersma */
  2772. ! #ifdef EXAMPLE
  2773. ! /*
  2774. ! EXAMPLE PROGRAM
  2775. ! DESCRIPTION
  2776. !     Read all lines from the password file and print all users
  2777. !     with password aging info. Also print a description of
  2778. !     the meaning of the aging information of this user.
  2779. ! AUTHOR
  2780. !     Hildo Biersma (boender@dutiws.twi.tudelft.nl)
  2781. ! STATUS
  2782. !     Example code; in the public domain.
  2783. ! */
  2784. ! #include <support.h>
  2785. ! void main()
  2786. ! {
  2787. !   struct passwd *this_entry;
  2788. !   int max_age, min_age;
  2789. !   char *ptr, min[2], max[2];
  2790. !   time_t time;
  2791. !   
  2792. !   min[1] = max[1] = 0x00;
  2793. !   while ((this_entry = getpwent()) != NULL)
  2794. !     if ((this_entry->pw_age[0]) != 0x00)
  2795. !     {
  2796. !       if ((max[0] = this_entry->pw_age[0]) != 0x00)
  2797. !       {
  2798. !         max_age = (int)a64l(max);
  2799. !         if ((min[0] = this_entry->pw_age[1]) != 0x00)
  2800. !         {
  2801. !           min_age = (int)a64l(min);
  2802. !           ptr = this_entry->pw_age + 2;
  2803. !           time = a64l(ptr) * (3600L * 24 * 7); /* Seconds per week */
  2804. !         }
  2805. !         else
  2806. !           time = 0L;
  2807. !       }
  2808. !       else
  2809. !       {
  2810. !         min_age = 0;
  2811. !         time = 0L;
  2812. !       }
  2813. !       fprintf(stdout, "Name: %s, UID: %d.\n", this_entry->pw_name,
  2814. !               this_entry->pw_uid);
  2815. !       if ((max_age == 0) && (min_age == 0))
  2816. !         fprintf(stdout, "User should change password on next login.\n\n");
  2817. !       else if (min_age > max_age)
  2818. !         fprintf(stdout, "Only super-user may change password.\n\n");
  2819. !       else
  2820. !       {
  2821. !         fprintf(stdout, "Must change every %d weeks.\n", max_age);
  2822. !         fprintf(stdout, "May change every %d weeks.\n", min_age);
  2823. !         fprintf(stdout, "Last changed in week starting %s\n\n",
  2824. !                 ctime(&time));
  2825. !       }
  2826. !     }
  2827. !     
  2828. !   endpwent();
  2829. ! } /* End of main() */
  2830. ! #endif /* EXAMPLE */
  2831. ===================================================================
  2832. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/getuid.c,v
  2833. retrieving revision 1.10
  2834. diff -c -r1.10 getuid.c
  2835. *** 1.10    1993/02/18 00:00:27
  2836. --- getuid.c    1993/06/04 19:55:49
  2837. ***************
  2838. *** 67,80 ****
  2839.       return setgid(egid);
  2840.   }
  2841.   
  2842. - /* note: BSD getpgrp takes an argument, but ours doesn't */
  2843. - int getpgrp() { return __mint ? Pgetpgrp() : 0; }
  2844. - int setpgrp(pid, grp)
  2845. -     int pid, grp;
  2846. - {
  2847. -     return __mint ? Psetpgrp(pid, grp) : 0;
  2848. - }
  2849.   int seteuid(x) int x; { return setuid(x); }
  2850.   int setegid(x) int x; { return setgid(x); }
  2851. --- 67,71 ----
  2852. ===================================================================
  2853. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/grp.c,v
  2854. retrieving revision 1.6
  2855. diff -c -r1.6 grp.c
  2856. *** 1.6    1992/09/14 14:56:40
  2857. --- grp.c    1993/07/10 16:36:46
  2858. ***************
  2859. *** 4,129 ****
  2860.    * getpwent routines (see getpw.c).
  2861.    */
  2862.   
  2863.   #include <stdio.h>
  2864.   #include <string.h>
  2865.   #include <stdlib.h>
  2866.   #include <unistd.h>
  2867.   #include <grp.h>
  2868.   
  2869. ! static char *grpfile = "/etc/group";    /* default group file */
  2870.   static FILE *fp;
  2871.   
  2872. ! static struct group curentry;        /* static data to return */
  2873.   
  2874. ! static int nextent __PROTO((void));
  2875.   
  2876. ! void setgrent ()
  2877.   {
  2878. !     if (fp)
  2879. !         rewind (fp);
  2880. ! #ifdef atarist
  2881. !     else if ((fp = fopen (grpfile, "rt")) == NULL)
  2882. ! #else
  2883. !     else if ((fp = fopen (grpfile, "r")) == NULL)
  2884. ! #endif
  2885. !     {
  2886.   #ifdef VERBOSE
  2887. !         fprintf (stderr,
  2888. !             "setgrent: %s non-existant or unreadable.\n", grpfile);
  2889.   #endif
  2890. !     }
  2891. ! }
  2892.   
  2893. ! void endgrent ()
  2894.   {
  2895. !     if (fp)
  2896. !     {
  2897. !         fclose (fp);
  2898. !         fp = NULL;
  2899. !     }
  2900. ! }
  2901.   
  2902. ! struct group *getgrent ()
  2903.   {
  2904. !     if (!fp) setgrent();
  2905. !     if (!fp) return NULL;
  2906.   
  2907. !     if (! nextent ())
  2908. !         return (NULL);
  2909. !     else
  2910. !         return (& curentry);
  2911. ! }
  2912.   
  2913. ! struct group *getgrgid (gid)
  2914. !     int gid;
  2915.   {
  2916. !     setgrent();
  2917.   
  2918. !     while (nextent ())
  2919. !         if (curentry.gr_gid == gid)
  2920. !             return (& curentry);
  2921.   
  2922. !     return (NULL);
  2923. ! }
  2924.   
  2925. ! struct group *getgrnam (name)
  2926. ! register char *name;
  2927.   {
  2928. !     setgrent();
  2929.   
  2930. !     while (nextent ())
  2931. !         if (strcmp (curentry.gr_name, name) == 0)
  2932. !             return (& curentry);
  2933.   
  2934. !     return (NULL);
  2935. ! }
  2936.   
  2937. ! #define MAX_MEMBERS 128        /* max. number of members in a group */
  2938.   
  2939.   static char savbuf[512];
  2940.   static char *memb[MAX_MEMBERS];
  2941.   
  2942. ! static int nextent ()
  2943.   {
  2944. !     register char *cp;
  2945. !     register int i;
  2946. !     if (!fp) setgrent();
  2947. !     if (!fp) return 0;
  2948.   
  2949. !     if (fgets (savbuf, (int) sizeof(savbuf), fp) != NULL)
  2950. !     {
  2951. !         for (cp = savbuf; *cp && *cp != ':'; cp++)
  2952. !             ;
  2953. !         curentry.gr_name = savbuf;
  2954. !         *cp++ = '\0';
  2955. !         curentry.gr_passwd = cp;
  2956. !         for (; *cp && *cp != ':'; cp++)
  2957. !             ;
  2958. !         *cp++ = '\0';
  2959. !         curentry.gr_gid = atoi (cp);
  2960. !         for (; *cp && *cp != ':'; cp++)
  2961. !             ;
  2962. !         *cp++ = '\0';
  2963. !         i = 0;
  2964. !         while( *cp ) {
  2965. !             if (i >= MAX_MEMBERS-1) break;
  2966. !             memb[i++] = cp;
  2967. !             for(; *cp && *cp != ',' && *cp != '\n'; cp++)
  2968. !                 ;
  2969. !             if (*cp == '\n')
  2970. !                 *cp = 0;
  2971. !             else if (*cp)
  2972. !                 *cp++ = 0;
  2973. !         }
  2974. !         memb[i] = NULL;
  2975. !         curentry.gr_mem = memb;
  2976. !         return (1);
  2977. !     }
  2978. !     return (0);
  2979. ! }
  2980.   
  2981.   #ifdef TEST
  2982.   int
  2983. --- 4,157 ----
  2984.    * getpwent routines (see getpw.c).
  2985.    */
  2986.   
  2987. + /*
  2988. +   Revised by Hildo Biersma (boender@dutiws.twi.tudelft.nl)
  2989. +   Revision 1 (January 31, 1993): include fgetgrent()
  2990. + */
  2991.   #include <stdio.h>
  2992.   #include <string.h>
  2993.   #include <stdlib.h>
  2994.   #include <unistd.h>
  2995.   #include <grp.h>
  2996.   
  2997. ! static char *grpfile = "/etc/group";  /* default group file */
  2998.   static FILE *fp;
  2999.   
  3000. ! static struct group curentry;   /* static data to return */
  3001.   
  3002. ! static int nextent __PROTO((FILE *fp));
  3003.   
  3004. ! /* Rewind the group file to allow repeated searches */
  3005. ! void setgrent()
  3006.   {
  3007. !   if (fp != NULL)
  3008. !     rewind (fp);
  3009. !   else if ((fp = fopen (grpfile, "rt")) == NULL)
  3010. !   {
  3011.   #ifdef VERBOSE
  3012. !     fprintf (stderr,
  3013. !       "setgrent: %s non-existant or unreadable.\n", grpfile);
  3014.   #endif
  3015. !   }
  3016. ! } /* End of setgrent() */
  3017.   
  3018. ! /* Close the group file when processing is complete */
  3019. ! void endgrent()
  3020.   {
  3021. !   if (fp != NULL)
  3022. !   {
  3023. !     fclose (fp);
  3024. !     fp = NULL;
  3025. !   }
  3026. ! } /* End of endgrent() */
  3027.   
  3028. ! /* Get the next group structure in the file */
  3029. ! struct group *getgrent()
  3030.   {
  3031. !   if (fp == NULL)
  3032. !     setgrent();
  3033. !   if (fp == NULL)
  3034. !     return NULL;
  3035.   
  3036. !   if (nextent(fp) == 0)
  3037. !     return(NULL);
  3038. !   else
  3039. !     return(&curentry);
  3040. ! } /* End of getgrent() */
  3041.   
  3042. ! /* Get first group with matching numerical group ID from file */
  3043. ! struct group *getgrgid(gid)
  3044. ! int gid;
  3045.   {
  3046. !   setgrent();
  3047.   
  3048. !   while (nextent(fp) != 0)
  3049. !     if (curentry.gr_gid == gid)
  3050. !       return(&curentry);
  3051.   
  3052. !   return(NULL);
  3053. ! } /* End of getgrid() */
  3054.   
  3055. ! /* Get first group with matching group name from file */
  3056. ! struct group *getgrnam(name)
  3057. ! const char *name;
  3058.   {
  3059. !   setgrent();
  3060.   
  3061. !   while (nextent(fp) != 0)
  3062. !     if (strcmp (curentry.gr_name, name) == 0)
  3063. !       return (&curentry);
  3064.   
  3065. !   return(NULL);
  3066. ! } /* End of getgrnam() */
  3067. ! /* Read the next group structure from a given file */
  3068. ! struct group *fgetgrent(f)
  3069. ! FILE *f;
  3070. ! {
  3071. !   if (f == NULL)
  3072. !     return(NULL); /* Failure */
  3073. !     
  3074. !   if (nextent(f) != 0)
  3075. !     return(&curentry); /* Success */
  3076.   
  3077. !   return(NULL); /* Failure */
  3078. ! } /* End of fgetgrent() */
  3079.   
  3080. + #define MAX_MEMBERS 128   /* max. number of members in a group */
  3081.   static char savbuf[512];
  3082.   static char *memb[MAX_MEMBERS];
  3083.   
  3084. ! static int nextent(fp)
  3085. ! FILE *fp;
  3086.   {
  3087. !   register char *cp;
  3088. !   register int i;
  3089.   
  3090. !   if (fp == NULL)
  3091. !     setgrent();
  3092. !   if (fp == NULL)
  3093. !     return(0);
  3094. !   if (fgets(savbuf, (int)sizeof(savbuf), fp) != NULL)
  3095. !   {
  3096. !     for (cp = savbuf; *cp && *cp != ':'; cp++)
  3097. !       ;
  3098. !     curentry.gr_name = savbuf;
  3099. !     *cp++ = 0x00;
  3100. !     curentry.gr_passwd = cp;
  3101. !     for (; *cp && *cp != ':'; cp++)
  3102. !       ;
  3103. !     *cp++ = 0x00;
  3104. !     curentry.gr_gid = atoi (cp);
  3105. !     for (; *cp && *cp != ':'; cp++)
  3106. !       ;
  3107. !     *cp++ = 0x00;
  3108. !     i = 0;
  3109. !     while( *cp )
  3110. !     {
  3111. !       if (i >= MAX_MEMBERS-1)
  3112. !         break;
  3113. !       for (; *cp == ' '; cp++)
  3114. !         ;
  3115. !       memb[i++] = cp;
  3116. !       for(; *cp && *cp != ',' && *cp != '\n'; cp++)
  3117. !         ;
  3118. !       if (*cp == '\n')
  3119. !         *cp = 0;
  3120. !       else if (*cp)
  3121. !         *cp++ = 0;
  3122. !     }
  3123. !     memb[i] = NULL;
  3124. !     curentry.gr_mem = memb;
  3125. !     return(1);
  3126. !   }
  3127. !   return(0);
  3128. ! } /* End of nextent() */
  3129.   
  3130.   #ifdef TEST
  3131.   int
  3132. ***************
  3133. *** 131,174 ****
  3134.   int argc;
  3135.   char **argv;
  3136.   {
  3137. !     struct group *gr;
  3138. !     char **m;
  3139.   
  3140. !     if (argc > 1) {
  3141. !         grpfile = argv[1];
  3142. !     }
  3143. !     setgrent ();
  3144. !     while ((gr = getgrent ()) != NULL)
  3145. !     {
  3146. !         printf ("%s:[%s] %d\n",
  3147. !             gr->gr_name,
  3148. !             gr->gr_passwd,
  3149. !             gr->gr_gid);
  3150. !         for (m = gr->gr_mem; *m; m++) {
  3151. !             printf("\t%s\n", *m);
  3152. !         }
  3153. !     }
  3154. !     endgrent ();
  3155. !     if (gr = getgrnam ("mail")) {
  3156. !         printf ("%s:[%s] %d\n",
  3157. !             gr->gr_name,
  3158. !             gr->gr_passwd,
  3159. !             gr->gr_gid);
  3160. !         for (m = gr->gr_mem; *m; m++) {
  3161. !             printf("\t%s\n", *m);
  3162. !         }
  3163. !     }
  3164. !     if (gr = getgrgid (1)) {
  3165. !         printf ("%s:[%s] %d\n",
  3166. !             gr->gr_name,
  3167. !             gr->gr_passwd,
  3168. !             gr->gr_gid);
  3169. !         for (m = gr->gr_mem; *m; m++) {
  3170. !             printf("\t%s\n", *m);
  3171. !         }
  3172. !     }
  3173. !     return 0;
  3174.   }
  3175.   #endif
  3176. --- 159,202 ----
  3177.   int argc;
  3178.   char **argv;
  3179.   {
  3180. !   struct group *gr;
  3181. !   char **m;
  3182.   
  3183. !   if (argc > 1) {
  3184. !     grpfile = argv[1];
  3185. !   }
  3186. !   setgrent ();
  3187. !   while ((gr = getgrent ()) != NULL)
  3188. !   {
  3189. !     printf ("%s:[%s] %d\n",
  3190. !       gr->gr_name,
  3191. !       gr->gr_passwd,
  3192. !       gr->gr_gid);
  3193. !     for (m = gr->gr_mem; *m; m++) {
  3194. !       printf("\t%s\n", *m);
  3195. !     }
  3196. !   }
  3197. !   endgrent ();
  3198. !   if (gr = getgrnam ("mail")) {
  3199. !     printf ("%s:[%s] %d\n",
  3200. !       gr->gr_name,
  3201. !       gr->gr_passwd,
  3202. !       gr->gr_gid);
  3203. !     for (m = gr->gr_mem; *m; m++) {
  3204. !       printf("\t%s\n", *m);
  3205. !     }
  3206. !   }
  3207. !   if (gr = getgrgid (1)) {
  3208. !     printf ("%s:[%s] %d\n",
  3209. !       gr->gr_name,
  3210. !       gr->gr_passwd,
  3211. !       gr->gr_gid);
  3212. !     for (m = gr->gr_mem; *m; m++) {
  3213. !       printf("\t%s\n", *m);
  3214. !     }
  3215. !   }
  3216. !   return 0;
  3217.   }
  3218.   #endif
  3219. ===================================================================
  3220. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/lib.h,v
  3221. retrieving revision 1.9
  3222. diff -c -r1.9 lib.h
  3223. *** 1.9    1993/03/01 17:34:34
  3224. --- lib.h    1993/07/10 16:36:48
  3225. ***************
  3226. *** 39,46 ****
  3227.   __EXTERN time_t        _dostime __PROTO((time_t));
  3228.   __EXTERN time_t        _unixtime __PROTO((unsigned int, unsigned int));
  3229.   
  3230. - __EXTERN char *        findfile __PROTO((char *, char *, char **));
  3231.   __EXTERN char *        _itoa __PROTO((int, char *, int));
  3232.   __EXTERN char *        _ltoa __PROTO((long, char *, int));
  3233.   __EXTERN char *        _ultoa __PROTO((unsigned long, char *, int));
  3234. --- 39,44 ----
  3235. ===================================================================
  3236. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/linea.c,v
  3237. retrieving revision 1.5
  3238. diff -c -r1.5 linea.c
  3239. *** 1.5    1992/10/09 20:35:29
  3240. --- linea.c    1993/07/10 16:36:49
  3241. ***************
  3242. *** 35,47 ****
  3243.   
  3244.   int linea2()                             
  3245.   {                                    
  3246.       __asm__ volatile                        
  3247.       ("
  3248.           .word   0xA002"
  3249. !     :                           /* outputs */    
  3250.       :                           /* inputs  */    
  3251.       : "d0", "d1", "d2", "a0", "a1", "a2"       /* clobbered regs */    
  3252.       );                                
  3253.   }
  3254.   
  3255.   void linea3()                             
  3256. --- 35,50 ----
  3257.   
  3258.   int linea2()                             
  3259.   {                                    
  3260. +     register long retvalue __asm__("d0");
  3261.       __asm__ volatile                        
  3262.       ("
  3263.           .word   0xA002"
  3264. !     : "=r"(retvalue)                  /* outputs */    
  3265.       :                           /* inputs  */    
  3266.       : "d0", "d1", "d2", "a0", "a1", "a2"       /* clobbered regs */    
  3267.       );                                
  3268. +     return (int) retvalue;
  3269.   }
  3270.   
  3271.   void linea3()                             
  3272. ===================================================================
  3273. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/modf.cpp,v
  3274. retrieving revision 1.3
  3275. diff -c -r1.3 modf.cpp
  3276. *** 1.3    1993/05/29 20:28:48
  3277. --- modf.cpp    1993/07/13 17:03:45
  3278. ***************
  3279. *** 124,147 ****
  3280.       .globl _modf
  3281.   .even
  3282.   _modf:
  3283. -     movel    a1,a7@-            | save a1 (necessary?)
  3284.       lea    0xfffffa50:w,a0
  3285.       movew    #0x5403,a0@(comm)    | fintrz X -> fp0
  3286.       cmpiw    #0x8900,a0@(resp)    | check
  3287. !     movel    a7@(8),a0@        | load X_hi
  3288. !     movel    a7@(12),a0@        | load X_low
  3289.   
  3290.       movew    #0x5480,a0@(comm)    | X -> fp1
  3291.       .long    0x0c688900, 0xfff067f8
  3292. !     movel    a7@(8),a0@        | load X_hi
  3293. !     movel    a7@(12),a0@        | load X_low
  3294.   
  3295.   |    000 000 001 0101000        | sub fp0 -> fp1
  3296.       movew    #0x00a8,a0@(comm)    | sub fp0 -> fp1
  3297.       .word    0x4a68,0xfff0,0x6bfa    | test
  3298.   
  3299.       movew    #0x7400,a0@(comm)    | fp0 to IntPart
  3300. !     moveal    a7@(16),a1        | address of IntPart while the fpu is active
  3301.   | wait
  3302.       .long    0x0c688900, 0xfff067f8
  3303.       movel    a0@,a1@+
  3304. --- 124,146 ----
  3305.       .globl _modf
  3306.   .even
  3307.   _modf:
  3308.       lea    0xfffffa50:w,a0
  3309.       movew    #0x5403,a0@(comm)    | fintrz X -> fp0
  3310.       cmpiw    #0x8900,a0@(resp)    | check
  3311. !     movel    a7@(4),a0@        | load X_hi
  3312. !     movel    a7@(8),a0@        | load X_low
  3313.   
  3314.       movew    #0x5480,a0@(comm)    | X -> fp1
  3315.       .long    0x0c688900, 0xfff067f8
  3316. !     movel    a7@(4),a0@        | load X_hi
  3317. !     movel    a7@(8),a0@        | load X_low
  3318.   
  3319.   |    000 000 001 0101000        | sub fp0 -> fp1
  3320.       movew    #0x00a8,a0@(comm)    | sub fp0 -> fp1
  3321.       .word    0x4a68,0xfff0,0x6bfa    | test
  3322.   
  3323.       movew    #0x7400,a0@(comm)    | fp0 to IntPart
  3324. !     moveal    a7@(12),a1        | address of IntPart while the fpu is active
  3325.   | wait
  3326.       .long    0x0c688900, 0xfff067f8
  3327.       movel    a0@,a1@+
  3328. ***************
  3329. *** 151,157 ****
  3330.       .long    0x0c688900, 0xfff067f8
  3331.       movel    a0@,d0
  3332.       movel    a0@,d1
  3333. -     movel    a7@+,a1            | restore a1
  3334.        rts
  3335.   
  3336.   #endif    sfp004
  3337. --- 150,155 ----
  3338. ===================================================================
  3339. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/psignal.c,v
  3340. retrieving revision 1.5
  3341. diff -c -r1.5 psignal.c
  3342. *** 1.5    1992/06/01 01:54:10
  3343. --- psignal.c    1993/07/10 16:36:51
  3344. ***************
  3345. *** 6,11 ****
  3346. --- 6,12 ----
  3347.   #include <signal.h>
  3348.   #include <siglist.h>
  3349.   #include <string.h>
  3350. + #include <unistd.h>
  3351.   #include "lib.h"
  3352.     
  3353.   void
  3354. ===================================================================
  3355. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/putenv.c,v
  3356. retrieving revision 1.2
  3357. diff -c -r1.2 putenv.c
  3358. *** 1.2    1992/09/14 14:56:40
  3359. --- putenv.c    1993/07/10 16:36:53
  3360. ***************
  3361. *** 45,51 ****
  3362.   
  3363.   int
  3364.   putenv(strng)
  3365. !     char *strng;
  3366.   {
  3367.       int i = 0;
  3368.       char **e;
  3369. --- 45,51 ----
  3370.   
  3371.   int
  3372.   putenv(strng)
  3373. !     const char *strng;
  3374.   {
  3375.       int i = 0;
  3376.       char **e;
  3377. ***************
  3378. *** 68,74 ****
  3379.           return -1;
  3380.   
  3381.       environ = e;
  3382. !     environ[i] = strng;
  3383.       environ[i+1] = 0;
  3384.       return 0;
  3385.   }
  3386. --- 68,74 ----
  3387.           return -1;
  3388.   
  3389.       environ = e;
  3390. !     environ[i] = (char *)strng;
  3391.       environ[i+1] = 0;
  3392.       return 0;
  3393.   }
  3394. ===================================================================
  3395. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/raise.c,v
  3396. retrieving revision 1.2
  3397. diff -c -r1.2 raise.c
  3398. *** 1.2    1991/04/26 03:42:08
  3399. --- raise.c    1993/07/10 16:36:54
  3400. ***************
  3401. *** 3,8 ****
  3402. --- 3,9 ----
  3403.   */
  3404.   
  3405.   #include <unistd.h>
  3406. + #include <signal.h>
  3407.   
  3408.   int
  3409.   raise(sig)
  3410. ===================================================================
  3411. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/random.c,v
  3412. retrieving revision 1.8
  3413. diff -c -r1.8 random.c
  3414. *** 1.8    1992/09/14 14:56:40
  3415. --- random.c    1993/07/10 16:36:56
  3416. ***************
  3417. *** 189,195 ****
  3418.       unsigned        x;
  3419.   {
  3420.           register  int        i /* , j */ ;
  3421. -     long random();
  3422.   
  3423.       if(  rand_type  ==  TYPE_0  )  {
  3424.           state[ 0 ] = x;
  3425. --- 189,194 ----
  3426. ===================================================================
  3427. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/regexp.c,v
  3428. retrieving revision 1.7
  3429. diff -c -r1.7 regexp.c
  3430. *** 1.7    1993/02/18 00:00:30
  3431. --- regexp.c    1993/07/10 16:36:59
  3432. ***************
  3433. *** 591,598 ****
  3434.   
  3435.     place = opnd;            /* Op node, where operand used to be. */
  3436.     *place++ = op;
  3437. !   *place++ = '\0';
  3438. !   *place++ = '\0';
  3439.   }
  3440.   
  3441.   /*
  3442. --- 591,597 ----
  3443.   
  3444.     place = opnd;            /* Op node, where operand used to be. */
  3445.     *place++ = op;
  3446. !   *place = '\0';
  3447.   }
  3448.   
  3449.   /*
  3450. ===================================================================
  3451. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/regsup.c,v
  3452. retrieving revision 1.1
  3453. diff -c -r1.1 regsup.c
  3454. *** 1.1    1991/04/12 18:19:53
  3455. --- regsup.c    1993/07/10 16:37:01
  3456. ***************
  3457. *** 86,90 ****
  3458.           }
  3459.       }
  3460.     }
  3461. !   *dst++ = '\0';
  3462.   }
  3463. --- 86,90 ----
  3464.           }
  3465.       }
  3466.     }
  3467. !   *dst = '\0';
  3468.   }
  3469. ===================================================================
  3470. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/setjmp.cpp,v
  3471. retrieving revision 1.5
  3472. diff -c -r1.5 setjmp.cpp
  3473. *** 1.5    1992/10/09 20:35:29
  3474. --- setjmp.cpp    1993/07/10 16:37:02
  3475. ***************
  3476. *** 1,25 ****
  3477.   |
  3478.   | setjmp.cpp 
  3479.   |
  3480.       .text
  3481.       .even
  3482.       .globl _setjmp
  3483.   _setjmp:
  3484.       movel    sp@(4),a0        | address of jmp_buf[]
  3485.       movel    sp@,a0@            | save return address
  3486.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  3487.       clrl    d0            | return value is 0
  3488.       rts
  3489.   
  3490.       .globl _longjmp
  3491. -     .globl ___mint
  3492. - #ifdef __MBASE__
  3493. - #define Mint    __MBASE__@(___mint)
  3494. - #else
  3495. - #define Mint    ___mint
  3496. - #endif
  3497.   _longjmp:
  3498.   #ifdef __MSHORT__
  3499.       tstw    Mint            | see if MiNT is active
  3500. --- 1,57 ----
  3501.   |
  3502.   | setjmp.cpp 
  3503.   |
  3504. +     .globl ___mint
  3505. + #ifdef __MBASE__
  3506. + #define Mint    __MBASE__@(___mint)
  3507. + #define Sigmask    __MBASE__@(__sigmask)
  3508. + #else
  3509. + #define Mint    ___mint
  3510. + #define Sigmask __sigmask
  3511. + #endif
  3512.       .text
  3513.       .even
  3514. +     .globl _sigsetjmp
  3515. + _sigsetjmp:
  3516. +     movel    sp@(4), a0        | address of sigjmp_buf[]
  3517. + #ifdef __MSHORT__
  3518. +     movew    sp@(8), d0
  3519. +     extl    d0
  3520. + #else
  3521. +     movel    sp@(8), d0
  3522. + #endif
  3523. +     movel    d0, a0@(56)        | save sigmask for siglongjmp?
  3524. +     beq    SETJMP            | no -- call common code
  3525. +     movel    Sigmask, a0@(52)    | save tos emulation signal mask
  3526. + #ifdef __MSHORT__
  3527. +     tstw    Mint            | see if MiNT is active
  3528. + #else
  3529. +     tstl    Mint
  3530. + #endif
  3531. +     beq    SETJMP            | no -- call common code
  3532. +     movel    #0, sp@-        | add no signals to sigmask
  3533. +     movew    #0x116, sp@-        | Psigblock() system call
  3534. +     trap    #1            |
  3535. +     addqw    #6, sp
  3536. +     movel    d0, a0@(52)        | save MiNT signal mask
  3537. +     jmp    SETJMP            | call common code
  3538.       .globl _setjmp
  3539.   _setjmp:
  3540.       movel    sp@(4),a0        | address of jmp_buf[]
  3541. +     movel    #0, a0@(56)        | do not restore sigmask on longjmp
  3542. + SETJMP:
  3543.       movel    sp@,a0@            | save return address
  3544.       moveml    d2-d7/a2-a7,a0@(4)    | save registers d2-d7/a2-a7
  3545.       clrl    d0            | return value is 0
  3546.       rts
  3547.   
  3548. +     .globl _siglongjmp
  3549. + _siglongjmp:
  3550.       .globl _longjmp
  3551.   _longjmp:
  3552.   #ifdef __MSHORT__
  3553.       tstw    Mint            | see if MiNT is active
  3554. ***************
  3555. *** 32,37 ****
  3556. --- 64,83 ----
  3557.       addqw    #2, sp
  3558.   NOMINT:
  3559.       movel    sp@(4),a0        | address of jmp_buf[]
  3560. +     tstl    a0@(56)            | want to restore sigmask?
  3561. +     beq    NORESTORE        | no -- skip restore code
  3562. +     movel    a0@(52), Sigmask    | restore tos emulation signal mask
  3563. + #ifdef __MSHORT__
  3564. +     tstw    Mint            | see if MiNT is active
  3565. + #else
  3566. +     tstl    Mint
  3567. + #endif
  3568. +     beq    NORESTORE        | no -- do not call sigsetmask
  3569. +     movel    a0@(52), sp@-        | restore signal mask
  3570. +     movew    #0x117, sp@-        | Psigsetmask() system call
  3571. +     trap    #1            |
  3572. +     addqw    #6, sp
  3573. + NORESTORE:
  3574.   #ifdef __MSHORT__
  3575.       movew    sp@(8),d0        | value to return
  3576.   #else
  3577. ===================================================================
  3578. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strerror.c,v
  3579. retrieving revision 1.6
  3580. diff -c -r1.6 strerror.c
  3581. *** 1.6    1993/03/01 17:34:39
  3582. --- strerror.c    1993/07/10 16:37:03
  3583. ***************
  3584. *** 94,100 ****
  3585.       "name too long",            /* 86 */
  3586.       "not a tty",                /* 87 */
  3587.       "range error",                /* 88 */
  3588. !     "domain error"                /* 89 */
  3589.       };
  3590.   
  3591.   int    sys_nerr = (int)(sizeof(sys_errlist)/sizeof(sys_errlist[0]));
  3592. --- 94,102 ----
  3593.       "name too long",            /* 86 */
  3594.       "not a tty",                /* 87 */
  3595.       "range error",                /* 88 */
  3596. !     "domain error",                /* 89 */
  3597. !     "I/O error",                /* 90 */
  3598. !     "disk full"                /* 91 */
  3599.       };
  3600.   
  3601.   int    sys_nerr = (int)(sizeof(sys_errlist)/sizeof(sys_errlist[0]));
  3602. ===================================================================
  3603. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strlwr.c,v
  3604. retrieving revision 1.3
  3605. diff -c -r1.3 strlwr.c
  3606. *** 1.3    1993/03/01 17:34:43
  3607. --- strlwr.c    1993/07/10 16:37:05
  3608. ***************
  3609. *** 1,4 ****
  3610. --- 1,5 ----
  3611.   #include <ctype.h>
  3612. + #include <string.h>
  3613.   
  3614.   char *strlwr(string)
  3615.   register char *string;
  3616. ===================================================================
  3617. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strrev.c,v
  3618. retrieving revision 1.2
  3619. diff -c -r1.2 strrev.c
  3620. *** 1.2    1989/03/25 02:43:09
  3621. --- strrev.c    1993/07/10 16:37:06
  3622. ***************
  3623. *** 4,9 ****
  3624. --- 4,11 ----
  3625.    * please change mktemp.c too (it assumes rev is in-place)
  3626.    */
  3627.   
  3628. + #include <string.h>
  3629.   char *strrev(string)
  3630.       char *string;
  3631.       {
  3632. ===================================================================
  3633. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/strupr.c,v
  3634. retrieving revision 1.2
  3635. diff -c -r1.2 strupr.c
  3636. *** 1.2    1993/03/01 17:34:47
  3637. --- strupr.c    1993/07/10 16:37:07
  3638. ***************
  3639. *** 1,5 ****
  3640. --- 1,6 ----
  3641.   /* hohmuth 1-Nov-92, derived from strlwr.c */
  3642.   #include <ctype.h>
  3643. + #include <string.h>
  3644.   
  3645.   char *strupr(string)
  3646.   register char *string;
  3647. ===================================================================
  3648. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/sysvar.c,v
  3649. retrieving revision 1.3
  3650. diff -c -r1.3 sysvar.c
  3651. *** 1.3    1992/09/14 14:56:40
  3652. --- sysvar.c    1993/07/10 16:37:08
  3653. ***************
  3654. *** 8,14 ****
  3655.       long ret;
  3656.       long save_ssp;
  3657.       
  3658. !     save_ssp = Super(0L);
  3659.       /* note: dont remove volatile, otherwise gcc will reorder these
  3660.          statements and we get bombs
  3661.        */
  3662. --- 8,14 ----
  3663.       long ret;
  3664.       long save_ssp;
  3665.       
  3666. !     save_ssp = (long) Super((void *) 0L);
  3667.       /* note: dont remove volatile, otherwise gcc will reorder these
  3668.          statements and we get bombs
  3669.        */
  3670. ***************
  3671. *** 24,30 ****
  3672.   {
  3673.       long save_ssp;
  3674.       
  3675. !     save_ssp = Super(0L);
  3676.       *((volatile long *)var) = val;
  3677.       (void)Super((void *) save_ssp);
  3678.   }
  3679. --- 24,30 ----
  3680.   {
  3681.       long save_ssp;
  3682.       
  3683. !     save_ssp = (long) Super((void *) 0L);
  3684.       *((volatile long *)var) = val;
  3685.       (void)Super((void *) save_ssp);
  3686.   }
  3687. ===================================================================
  3688. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/textio.c,v
  3689. retrieving revision 1.5
  3690. diff -c -r1.5 textio.c
  3691. *** 1.5    1992/10/09 20:35:29
  3692. --- textio.c    1993/07/10 16:37:10
  3693. ***************
  3694. *** 11,16 ****
  3695. --- 11,17 ----
  3696.   
  3697.   #include <stdio.h>
  3698.   #include <unistd.h>
  3699. + #include <support.h>
  3700.   
  3701.   int
  3702.   _text_read(fd, buf, nbytes)
  3703. ***************
  3704. *** 39,45 ****
  3705.   int
  3706.   _text_write(fd, from, nbytes)
  3707.       int fd;
  3708. !     char *from;
  3709.       int nbytes;
  3710.   {
  3711.   #ifdef __SOZOBON__
  3712. --- 40,46 ----
  3713.   int
  3714.   _text_write(fd, from, nbytes)
  3715.       int fd;
  3716. !     const char *from;
  3717.       int nbytes;
  3718.   {
  3719.   #ifdef __SOZOBON__
  3720. ===================================================================
  3721. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/timeoday.c,v
  3722. retrieving revision 1.2
  3723. diff -c -r1.2 timeoday.c
  3724. *** 1.2    1992/09/14 14:56:40
  3725. --- timeoday.c    1993/07/10 16:37:11
  3726. ***************
  3727. *** 51,57 ****
  3728.   
  3729.       tp->time = t;
  3730.       tp->millitm = 0;
  3731. !     tp->timezone = _timezone / 60;
  3732.       tp->dstflag = (_dst) ? 1 : 0;
  3733.   
  3734.       return 0;
  3735. --- 51,57 ----
  3736.   
  3737.       tp->time = t;
  3738.       tp->millitm = 0;
  3739. !     tp->timezone = (int)(_timezone / 60);
  3740.       tp->dstflag = (_dst) ? 1 : 0;
  3741.   
  3742.       return 0;
  3743. ===================================================================
  3744. RCS file: /net/acae127/home/bammi/etc/src/master/atari/co/utime.c,v
  3745. retrieving revision 1.11
  3746. diff -c -r1.11 utime.c
  3747. *** 1.11    1992/09/14 14:56:40
  3748. --- utime.c    1993/06/04 19:55:54
  3749. ***************
  3750. *** 16,21 ****
  3751. --- 16,29 ----
  3752.   #include <time.h>
  3753.   #include <errno.h>
  3754.   #include <osbind.h>
  3755. + #include <mintbind.h>
  3756. + #ifndef __MINT__
  3757. + #  define __MINT__
  3758. + #  include <ioctl.h>
  3759. + #  undef __MINT__
  3760. + #else
  3761. + #  include <ioctl.h>
  3762. + #endif
  3763.   #include <assert.h>
  3764.   #ifdef __TURBOC__
  3765.   #include <sys\types.h>
  3766. ***************
  3767. *** 24,35 ****
  3768.   #endif
  3769.   #include "lib.h"
  3770.   
  3771. ! time_t dostime __PROTO((time_t t));
  3772.   
  3773.   /* convert a Unix time into a DOS time. The longword returned contains
  3774.      the time word first, then the date word */
  3775.   
  3776. ! time_t dostime(t)
  3777.       time_t t;
  3778.   {
  3779.           time_t time, date;
  3780. --- 32,46 ----
  3781.   #endif
  3782.   #include "lib.h"
  3783.   
  3784. ! extern int __mint;
  3785. ! time_t _dostime __PROTO((time_t t));
  3786.   
  3787.   /* convert a Unix time into a DOS time. The longword returned contains
  3788.      the time word first, then the date word */
  3789.   
  3790. ! time_t
  3791. ! _dostime(t)
  3792.       time_t t;
  3793.   {
  3794.           time_t time, date;
  3795. ***************
  3796. *** 49,71 ****
  3797.         const struct utimbuf *tset;
  3798.   {
  3799.       int fh;
  3800. !     time_t settime;
  3801.       unsigned long dtime;    /* dos time equivalent */
  3802.       char filename[PATH_MAX];
  3803.   
  3804.       if (tset)
  3805. !         settime = tset->modtime;
  3806.       else
  3807. !         time(&settime);
  3808.   
  3809.       (void)_unx2dos(_filename, filename);
  3810. !     dtime = dostime(settime);    /* convert unix time to dos */
  3811.       fh = (int) Fopen(filename, 2);
  3812.       if (fh < 0) {
  3813.           errno = -fh;
  3814.           return -1;
  3815.       }
  3816. !     (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  3817.       if ((fh = Fclose(fh)) != 0) {
  3818.           errno = -fh;
  3819.           return -1;
  3820. --- 60,104 ----
  3821.         const struct utimbuf *tset;
  3822.   {
  3823.       int fh;
  3824. !     time_t actime, modtime;
  3825.       unsigned long dtime;    /* dos time equivalent */
  3826. +     
  3827.       char filename[PATH_MAX];
  3828. +     struct _mutimbuf settime;
  3829. +     long res;
  3830.   
  3831.       if (tset)
  3832. !     {
  3833. !         modtime = tset->modtime;
  3834. !         actime = tset->actime;
  3835. !     }
  3836.       else
  3837. !     {
  3838. !         time(&actime);
  3839. !         modtime = actime;
  3840. !     }
  3841.   
  3842.       (void)_unx2dos(_filename, filename);
  3843. !     dtime = _dostime(actime);
  3844. !     settime.actime = (unsigned short) ((dtime >> 16) & 0xFFFF);
  3845. !     settime.acdate = (unsigned short) (dtime & 0xFFFF);
  3846. !     dtime = _dostime(modtime);
  3847. !     settime.modtime = (unsigned short) ((dtime >> 16) & 0xFFFF);
  3848. !     settime.moddate = (unsigned short) (dtime & 0xFFFF);
  3849.       fh = (int) Fopen(filename, 2);
  3850.       if (fh < 0) {
  3851.           errno = -fh;
  3852.           return -1;
  3853.       }
  3854. !     res = -EINVAL;
  3855. !     if (__mint > 90)
  3856. !         res = Fcntl(fh, (long)&settime, FUTIME);
  3857. !     if (res == -EINVAL)
  3858. !         (void)Fdatime((_DOSTIME *) &dtime, fh, 1);
  3859.       if ((fh = Fclose(fh)) != 0) {
  3860.           errno = -fh;
  3861.           return -1;
  3862. ***************
  3863. *** 80,86 ****
  3864.       unsigned date, time;
  3865.   
  3866.       assert(t != 0);
  3867. !     dtime = dostime(*t);
  3868.       date = (int) (dtime & 0xffff);
  3869.       time = (int) (dtime >> 16) & 0xffff;
  3870.   
  3871. --- 113,119 ----
  3872.       unsigned date, time;
  3873.   
  3874.       assert(t != 0);
  3875. !     dtime = _dostime(*t);
  3876.       date = (int) (dtime & 0xffff);
  3877.       time = (int) (dtime >> 16) & 0xffff;
  3878.   
  3879.